You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Target: web not working for renderer processes with nodeIntegration: true
While it's certainly debatable whether or not to have nodeIntegration active in the renderer processes, I can't fully swap Zettlr over to the new sandboxed models in an instance. The newly added target: ['web', 'electron-renderer'] throws errors because webpack won't leave require()s alone (this includes the index.js from the electron-package, which is being called whenever some node module is being required). The only way I have found to solve it is to overwrite the target of the renderer
Proposed Solution
Add a nodeIntegration option to WebpackPluginRendererConfig which sets the target appropriately:
When nodeIntegration is true, the target is electron-renderer.
When nodeIntegration is false, the target is web.
Defaults to false since Electron has defaulted nodeIntegration to false since Electron 5.
Preflight Checklist
Problem Description
From #2289:
Proposed Solution
Add a
nodeIntegration
option toWebpackPluginRendererConfig
which sets thetarget
appropriately:nodeIntegration
istrue
, thetarget
iselectron-renderer
.nodeIntegration
isfalse
, thetarget
isweb
.Defaults to
false
since Electron has defaultednodeIntegration
tofalse
since Electron 5.Alternatives Considered
Again, from #2289:
This puts the onus on the app developer to know about Webpack targets, and I'd prefer to avoid that.
Additional Information
This will probably also need documentation on the website.
The text was updated successfully, but these errors were encountered: