requirejs / almond

A minimal AMD API implementation for use after optimized builds
Other
2.42k stars 169 forks source link

almond & node-webkit #88

Closed cniaulin closed 10 years ago

cniaulin commented 10 years ago

Hi,

I encounter issues when I try to run optimized code with almond inside a node-webkit app. Almond overwrite "require()" and so when the code running in node context try to load a module, it ends up loading it through almond.

What could be the best workaround ? Update almond in order to not define "require()" if it is not undefined ?

On the same topic, when optimizing code, almond insert some call to require(). I guess it could be replaced with call to requirejs() ?

Regards

jrburke commented 10 years ago

I suggest using the r.js wrap config to wrap the almond-based bundle in a function so that its definitions do not leak outside of that function.