Closed eminoda closed 7 years ago
First, ignoring node_modules
will likely cause your app to not work, because that's where everything in your dependencies
section of package.json
is installed. By default, all of your devDependencies
are removed when preparing your app.
Second, to ignore multiple things, you have two options:
--ignore
parameter multiple times|
feature of regular expressions, because as stated in the docs, ignore
takes a regular expression.@malept tks for your reply。
looked the api,u say prune can ignore node-module。
but in ‘electron quick start demo’ didnt work?
i tryed this way:
"scripts": { "start": "electron .", "win": "electron-packager . --prune=true --ignore=src --ignore=e2e --overwrite --platform=win32 --arch=ia32 --out=out --icon=favicon.ico" }
but in out node-modules still have logger
my package.json:
http://chuantu.biz/t6/13/1503216794x1700615998.png
result:
http://chuantu.biz/t6/13/1503216941x2918527080.png
here is my sample:git@github.com:eminoda/angular4-electron.git
npm run win
out/xx/node_modules,have another modules,i just think there are logger &log4js in node_modules
A few things:
node_modules
directory.devDependencies
for some reason, which would result in your app not working when prune is enabled. See the NPM docs for when you should use devDependencies
: https://docs.npmjs.com/files/package.json#devdependenciesthanks a lot
I use "package:win": "electron-packager . --ignore=src,node_modules --prune=true --overwrite --platform=win32 --arch=ia32 --out=out --icon=favicon.ico" but this result is ‘node_modules’ still exist.