mardi 29 décembre 2015

emberJS squashing nwJS require() method

I have a nwjs application that points to a web address that contains an ember application. Inside the ember application i need to get access to the node context to see what OS the user is running in order to do an update check. I do that in an initializer like so.

require('os')

Unfortunately i get this:

Error: Could not find module `os` imported from `(require)`

It appears that ember's require() method is squashing the one set by nwjs. I can confirm this by changing the nwjs window to point to google.com, setting the "node-remote" to "*", and then trying to run the require('os') command again. In this instance the module is resolved perfectly.

Ember's code reflects this. http://ift.tt/1YMvTwR

Is there another way to access the proper require() or do i need to create a "node-main" file and just do a

window.nodeRequire = require




Aucun commentaire:

Enregistrer un commentaire