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

I am currently writing a web application that I plan to deploy later with node -webkit. I want to use as little node.js as possible, so that I can easily deploy on the Internet without having to rewrite large parts of the code.

I use Jam.js as a package manager. Obviously, there is a node.js require problem that contradicts require.js require . Using requirejs instead of require seems like a great option. However, Jam.js compiles the require.config.js file and uses require inside it (instead of requirejs ).

Currently I need to do window.require = undefined; so that Jam.js require.js works in node -webkit.

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

Or there is another solution that allows you to use Jam.js and node.js require without having to do something like window.require = undefined; ? I found the solution presented in the node -webkit FAQ not very pleasant.

Thank you for your help!

+6
source share

Source: https://habr.com/ru/post/955485/


All Articles