6

I have an electron app and below is the folder structure.

app
|--node_modules
    |--somepackage/src
|--src

I am packaging this app using electron-packager, so I tried to ignore root level src folder by executing the below command.

"scripts": {
       "pack": "rimraf ./packaged/ && electron-packager . Test.Client --app-version=0.0.1 --prune --out=packaged --platform=win32 --arch=x64 --overwrite --ignore=webpack.config.js --ignore=/src 
  },

but here the problem is my node_modules also have some packages which contains src folder and those src folders are also getting ignored by above --ignore=/src statment.

Mahesh More
  • 821
  • 1
  • 8
  • 23
  • 1
    That src in node_modules are also kind of no use because those packages must be having builds to facilitate the execution. – Pankaj May 25 '18 at 08:53
  • 1
    yes, but I am using logstash-client package and which is asking for debug module dependency inside src folder. If I remove --ignore statement my packaged application works. – Mahesh More May 25 '18 at 08:56
  • Title sounds like the opposite of what OP asks. Maybe "how to _not_ ignore package src folder"?.. – ghybs May 26 '18 at 02:06

1 Answers1

22

By default, electron-packager is expecting a regular expression for the --ignore flag, so you may want to try --ignore=^/src to restrict the pattern to the root level...

Reference:

electron-packager API option: ignore