Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Jam.js, require.js and node-webkit without conflicts

I'm currently writing a web app that I later intend to deploy using node-webkit. I want to use as little node.js as possible so that I have the option to easily deploy to the web without having to rewrite large portions of the code.

I'm using Jam.js as a package manager. Obviously there is the issue of node.js's require conflicting with require.js's require. Using requirejs instead of require seems to be a great option. However, Jam.js compiles the require.config.js-file and uses require (instead of requirejs) inside of it.

Currently, I have to do window.require = undefined; to make Jam.js's require.js work in node-webkit.

Is there a way to make Jam.js compile the require.config.js-file using requirejs instead of require?

Or is there a different solution that lets me use both Jam.js and node.js's require without having to do something like window.require = undefined;? I find the solution presented in the node-webkit FAQ not very satisfying.

Thanks for your help!

like image 770
Macks Avatar asked Oct 08 '13 12:10

Macks


1 Answers

These links might help you with your issue:

http://requirejs.org/docs/node.html

http://durandaljs.com/documentation/Native-Apps-With-Node-Webkit.html

https://github.com/caolan/jam

like image 146
JFelton Avatar answered Oct 31 '22 02:10

JFelton