The @vercel/webpack-asset-relocator-loader
works in some modules, and does not work in some. In cases that it doesn't work, I have to use the externals config as stated in the electron-forge docs here.
If the asset relocator loader does not work for your native module, you may want to consider using the externals configuration
So what ended up happening is me putting the modules in the externals config like so:
// webpack.main.config.js
module.exports = {
// other webpack configs
externals: {
'active-win': 'commonjs2 active-win',
iohook: 'commonjs2 iohook',
'screenshot-desktop': 'commonjs2 screenshot-desktop',
},
};
What this does is, it will search the node_modules folder whenever those modules are used. This works in development but once the app is packaged, the node_modules folder is empty.
I tried to use @timfish/forge-externals-plugin library but it doesn't work on some modules that I use.
So how do I make it such that the node_modules folder is included in the packaged app? I'm not sure if this is an electron config or webpack config or both. Thanks...