4

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

kaya3
  • 47,440
  • 4
  • 68
  • 97
Zantinger
  • 167
  • 3
  • 16

3 Answers3

3

This variant works for me

--ignore=\"(docs*|dev*|somefile\.js)\"

Andrew Volodko
  • 131
  • 1
  • 9
1

Use the OR statement in the regular expression by using the | character in stead of the + character.

--ignore="docs/.*|dev/.*|somefile\.js"
  • this don't work. I saw that electron-packager support an array of regex, but all variations I tried end up with an error. For now I use the --ignore flag multiple times with one arg – Zantinger Dec 08 '16 at 20:02
  • @Zantinger I just changed the regex, I saw I made a mistake. I added the dot before the asterisk, now it will capture any character, in my previous regex it would just capture multiple slashes. Could you try again? – Christiaan van Bergen Dec 09 '16 at 21:42
1

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.

Martins
  • 508
  • 4
  • 12