Mahesh More
Mahesh More

Reputation: 855

How to ignore src folder from package

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.

Upvotes: 6

Views: 9040

Answers (1)

user8022331
user8022331

Reputation:

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

Upvotes: 23

Related Questions