Open Christilut opened 3 years ago
What is the use case for excluding modules? An example would also be helpful.
I'm using @journeyapps/sqlcipher but it is incompatible with electron-rebuild (see here). The suggested workaround is to use onlyModules
but that means I have to explicitly include modules I do want to use there.
@malept Another usecase is to exclude fsevents
module on e.g. MacOS. Typically, fsevents is used by dev tools like tsc --watch, cpx, webpack --watch etc., and electron-rebuild rebuilds this module too which causes watch-mode to stop working silently (chokidar internally used in all these tools just silently switches to polling mode which kills CPU).
If we had --exclude in electron-rebuild package, then we'd be able to tell it to not rebuild fsevents and thus keep the dev tools intact.
...Notice that packages like chokidar, jest-haste-map etc. have fsevents in package.json's optionalDependencies (which makes sense). That's why I guess electron-rebuild rebuilds it too.
We're also currently running into this issue specifically for fsevents on windows (where we need it on osx builds). An omit would be nice or some way to ignore and continue if a build fails.
My use case for wanting this: using node-sqlite3, but with SQLCipher, so I want to run a custom node-gyp for that rebuild only.
Here's the command we have to use
$ electron-rebuild --only @adeperio/forcefocus,@hypersprite/vscode-windows-registry,@nodert-win10-rs4/windows.foundation,@nodert-win10-rs4/windows.system,@sentry/electron,@slack/web-api,evernote,extract-file-icon,jsforce,keyboard-layout,keytar,node-abi,node-fetch,plist,sequelize
✔ Rebuild Complete
✨ Done in 9.71s.
What would be nice
$ electron-rebuild --exclude sqlite
Is there a way to exclude certain modules? There is
onlyModules
to do the opposite, but it's not very practical if you need to exclude a module to always have to keeponlyModuels
up to date.Also, is there a way to get electron-rebuild to list all the modules it's building? If I want to add all my current modules in
onlyModules
except one, I have no idea right now what modules it's actually building.