问题
How is the correct syntax to ignore more then one files and folders for electron-packager?
With only one arg like: --ignore=docs/*
it works fine. But I want to ignore more then one folder and files like: --ignore=docs/* + dev/* + someFile.js
回答1:
Use the OR statement in the regular expression by using the | character in stead of the + character.
--ignore="docs/.*|dev/.*|somefile\.js"
回答2:
This variant works for me
--ignore=\"(docs*|dev*|somefile\.js)\"
回答3:
For anyone out there who's looking for a simpler way of packaging an Angular application with Electron using electron-packager, this might get you sorted.
$ electron-packager . myapp --out=dist/builds/win --arch=x64 --icon=src/assets/images/win_icon.ico --asar --overwrite --ignore="(node_modules*|dist/builds*|dist/installers*|e2e*|src*)"
It works for me all the time, I use the terminal from VS Code.
来源:https://stackoverflow.com/questions/41039480/regex-pattern-to-ignore-multiple-folders