how to exclude node modules in app/node_module
5.23.2
Windows
I am using webpack to compile my src code so most directories inside app\node_modules are not required for publish.
Is there a way to exclude them during the build process ? thanks!
noticed there is already some docs, so will try it
https://github.com/electron-userland/electron-builder/wiki/Options#multiple-glob-patterns
Do you use 2 package.json structure? Why such modules added as production deps, but not as dev? Yes, we don't filter out for 2 package.json structure, but it should be fixed if need. So you will not need extra configuration.
yes, I use two 2 package.json structure, but I do not need some node modules inside app/node_module directory ( like react, which is very big ) as I have a compile version already, just do not want to include in the final asar
Maybe you can move react dep to dev package.json?
ok, thanks for your hint, will try and use filter like
"files": [
"**/*",
"!node_modules/async${/*}",
"!node_modules/classnames${/*}",
...
also works.
Could you please explain me why such dependencies in the app package.json, but not in the dev?
the reason is that we only do webpack build for the render process js files and not for the main.js in main.js it also required some packages and need to go with the asar file so we just put all these depended packages into app package.json
anyway, you gived me a gr8 hint that I will move these depended package for render process into outer package.json and remove the filter setting in the build config
Thanks.