问题
I'm using electron-packager for creating an electron.exe of my app. I need to exclude all node modules . I tried the following
--ignore=node_modules
The above is not working. Any idea how to exclude all folders/ remove node modules in final build.
回答1:
If you install modules as devDependencies
, they will all be pruned automatically before packaging.
If you're using electron-builder
you can define glob patterns as files in the config. In this case !**/node_modules/*
will exclude all of node_modules
.
If you're using electron-packager
you can use the ignore option and regular expression to exclude files.
来源:https://stackoverflow.com/questions/49446236/how-should-i-exclude-all-node-modules-in-electron-packager