arun thatham
arun thatham

Reputation: 500

How should i exclude all node_modules in electron-packager

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.

Upvotes: 9

Views: 18970

Answers (1)

Tim
Tim

Reputation: 8176

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.

Upvotes: 22

Related Questions