Add support for an include option (in addition to ignore)
See original GitHub issuePreflight Checklist
- I have read the contribution documentation for this project.
- I agree to follow the code of conduct that this project follows, as appropriate.
- I have searched the issue tracker for a feature request that matches the one I want to file, without success.
Problem Description
AFAICS (apologies if I missed smth) electron-packager has a way to ignore paths from getting copied to the output artifact, but blacklisting is a risky way to decide what goes in. Add a file with sensitive info to the repo, forget to add it to ignore, and BAM!
A whitelist is stable and does answer directly the question: what goes into the artifact?
Proposed Solution
In the best of worlds, you should just follow npm pack
, meaning respect the files
section in package.json
, and if none - respect the .npmignore
(or just stick to the current --ignore
flag).
Issue Analytics
- State:
- Created 4 years ago
- Reactions:12
- Comments:20 (6 by maintainers)
Top Results From Across the Web
.gitignore file - ignoring files in Git | Atlassian Git Tutorial
Git ignore patterns are used to exclude certain files in your working directory from your Git history. They can be local, global, or...
Read more >View, manage, and install add-ins for Microsoft 365 programs
View, manage, and install add-ins for Microsoft 365 programs ; Permanently disable or remove an add-in · Click File > Options > Add-ins...
Read more >gitignore Documentation - Git
Patterns which a user wants Git to ignore in all situations (e.g., backup or temporary files generated by the user's editor of choice)...
Read more >Add all files to a commit except a single file? - Stack Overflow
git add -u git reset -- main/dontcheckmein.txt. Note: Git has subsequently added special syntax for this, which is explained in other answers.
Read more >Dockerfile reference - Docker Documentation
Convention is also to include a blank line following any parser directives. ... By adding the escape parser directive, the following Dockerfile succeeds...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
👋 I was able to get the regex to work using
'^\/(?!(dist|node_modules|package\.json))'
(the initial slash ensures it is in the root) … if you include this as a script in yourpackage.json
make sure you escape the backslashes, e.g.,'^\\/(?!(dist|node_modules|package\\.json))'
Any news here? Please give me an example to exclude everything except one folder i.e. “dist”. I’m getting mad finding a working RegEx to provide it to the “ignore” parameter. This RegEx should work
^(?!.*(dist|node_modules)).*
but it doesn’t. Using this as “ignore” param I get no app folder at all - nothing gets copied. I couldn’t figure out what is used internally for the ignore match. Greetings (edit: maybe I have to build a script via the API to fit our project needs)