How to ignore src folder from package
Asked Answered
P

1

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.

Ploughman answered 25/5, 2018 at 8:16 Comment(3)
That src in node_modules are also kind of no use because those packages must be having builds to facilitate the execution.Valletta
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.Ploughman
Title sounds like the opposite of what OP asks. Maybe "how to not ignore package src folder"?..Vandiver
P
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

President answered 25/5, 2018 at 14:4 Comment(1)
Hi sorry for late reply. Thanks for looking into it and it's working as expected.Ploughman

© 2022 - 2024 — McMap. All rights reserved.