4

I've got an Electron project in node.js and am currently attempting to make distribution easier by collapsing the massive node_modules hierarchy into an asar. This way I can have app.asar and modules.asar, as suggested by various places such as grunt-asar.

The problem is that this needs me to change all require() statements to have the asar in the path, like: require('modules.asar/package'). That's fine for modules I'm including from my code but when a module itself uses require('dependency-package') that then fails to resolve. As I understand it, node.js will resolve in the "node_modules" folder for these but there is no "node_modules" directory anymore due to packaging modules into an asar.

Is there anything I can do to help this?

Dave
  • 141
  • 1
  • 9
  • Using [webpack aliases](http://xabikos.com/2015/10/03/Webpack-aliases-and-relative-paths/)? – Greg K May 01 '18 at 10:51

0 Answers0