Reputation: 15
I'm recently trying out electron 12 with webpack bundler, and lately realized every time It builds a distributable with yarn make
the build's node_module folder is empty.Hence, since I expose some modules through ContextBridge
from preload.js, the app crashes and throws a missing error message.
Regardless, It works after I manually copy the entire node_module folder into it.
Upvotes: 0
Views: 820
Reputation: 8186
The default configuration with electron-forge
and Webpack bundles your main/preload/renderer code.
This has mostly a positive impact:
node_modules
nodeIntegration: false
there is no require
in the renderers so bundling the code is a requirement if you want to use dependenciesrequire
'ing hundreds or possibly thousands of individual files can be slowWhat are the negatives?
Upvotes: 2