-
-
Notifications
You must be signed in to change notification settings - Fork 513
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(plugin-webpack): Allow each entrypoint to specify nodeIntegration
#2867
feat(plugin-webpack): Allow each entrypoint to specify nodeIntegration
#2867
Conversation
3d17fd2
to
c982d32
Compare
Codecov Report
@@ Coverage Diff @@
## master #2867 +/- ##
==========================================
- Coverage 71.69% 71.57% -0.13%
==========================================
Files 79 79
Lines 2392 2392
Branches 450 452 +2
==========================================
- Hits 1715 1712 -3
- Misses 454 551 +97
+ Partials 223 129 -94
Continue to review full report at Codecov.
|
b42d295
to
cb57497
Compare
cb57497
to
90f9e9d
Compare
90f9e9d
to
2a1219e
Compare
I've rebased these changed and fixed conflicts with the latest changes in I'm currently maintaining a fork of this here in case others need it: https://www.npmjs.com/package/@electron-forge/plugin-webpack Any feedback on if this is the right approach would be appreciated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @chetbox, thanks for submitting this PR! Overall, I think your implementation looks good - changing the rendererConfig return from a single config to an array of configs and handling the nodeIntegration at each entryPoint seems like a fine approach.
Would you mind rebasing this PR against current main, so we can get a fresh run of the test suite? We've merged some webpack work since you opened this PR, and I just want to make sure that the changes still pass with this new config generation. If the tests go green, I'm fine approving and merging 🙇♀️
2a1219e
to
cc960e6
Compare
Thank you kindly for the review @VerteDinde! I've rebased the changes against |
Hey @VerteDinde! Is this good to go or do you need anything else from me? |
@chetbox Ah, I missed that the test re-run had passed! I'll approve and merge - thanks again for submitting this PR! 🙇♀️ |
❤️ 🙏 I've been waiting for this! |
Summarize your changes:
Summarize your changes:
Note that this replaces #2856 based on this suggestion.
We have multiple BrowserWindows in our project, some which use
nodeIntegration: false
and some which usenodeIntegration: true
.Without this change we get the error require is not defined at runtime in the BrowserWindows with nodeIntegration: false.
We didn't need to do this with older versions of
@electron-forge/plugin-webpack
that used Webpack 4 where we could simply not import any Node JS modules and just use browser-targeted modules.@electron-forge/plugin-webpack
only allows us to set one target for all entrypoints. This change allows overriding thenodeIntegration
value for a specific entrypoint. e.g.This uses Webpack's ability to pass an array of webpack configurations rather than a single configuration.