I'm try to packaging my electron app, and it requires mqtt and node-notifier module. So I want to do is exclude all node_modules except them.
Let's assume that I want to exclude these files from packaging:
- npm-debug
- gulpfile.js
- .vscode
So setting --ignore option like this:
--ignore='npm-debug|gulpfile\.js|\.vscode'
working fine. But additionally excluding node_modules except mqtt and node-notifier, I don't know how to make regex!
--ignore='npm-debug|gulpfile\.js|\.vscode|^((?!node_modules/mqtt).)$' // NOT WORKING
Only checking node_modules, /^((?!node_modules/mqtt).)$/ is work, but combine them into single regex line, it's not working.
I know my regex was wrong, but I tried every combination of regex characters and my imagination, every attempt was failed and couldn't found any solution on google.
This is Regex Testing site, you can see where am I stucked.
Any advice will be very appreciated. Thanks!
From packager github page
From electron-packager API page about
--prune
flagYou should be able to simply put all packages except
mqtt
indevDependencies
and run packaging