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!

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


Need Your Help

PHP class variable set/get problem

php class variables

I've attempted to write a PHP class that gets the uptime of my Linux machine. It will get the uptime correctly, but I have an if statement that determines whether or not the load average is "high" ...