0

I am in the process of developing my first Electron application, and I have a few questions regarding deployment.

I am developing on MacOS and using electron-packager to package it for both MacOS and Windows.

There appear to be a large number of modules in the node_modules directory. I know they don’t take up so much space, but the number of files certainly slows down the packaging and zipping/unzipping process. How can I trim the unused modules?

There also appear to be a large number of locales which I don’t use. Ditto.

Manngo
  • 14,066
  • 10
  • 88
  • 110

1 Answers1

0

If you install modules as devDependencies, they will all be pruned automatically before packaging.

If you're using electron-packager you can use the ignore option and regular expression to exclude files.

I suggest you to use electron-builder instead of electron-packager. You can get the best difference of both here difference between electron-builder and electron-packager.

If you're using electron-builder you can define patterns as files in the config. In this case !**/node_modules/* will exclude all of node_modules.