简体   繁体   中英

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM