最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to ignore src folder from package - Stack Overflow

programmeradmin4浏览0评论

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.

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.

Share Improve this question asked May 25, 2018 at 8:16 Mahesh MoreMahesh More 8551 gold badge8 silver badges24 bronze badges 3
  • 1 That src in node_modules are also kind of no use because those packages must be having builds to facilitate the execution. – Pankaj Commented May 25, 2018 at 8: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 Commented May 25, 2018 at 8:56
  • Title sounds like the opposite of what OP asks. Maybe "how to not ignore package src folder"?.. – ghybs Commented May 26, 2018 at 2:06
Add a comment  | 

1 Answer 1

Reset to default 23

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

发布评论

评论列表(0)

  1. 暂无评论