How should i exclude all node_modules in electron-packager

喜欢而已 提交于 2019-12-10 20:25:12

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!