Vite plugin: support `nodeIntegration: true` in the renderer process.
Author: hab25Created Jul 11, 2025Updated Aug 31, 2026
Labelsenhancementplugin/vite
Pre-flight checklist
- I have read the contribution documentation for this project.
- I agree to follow the code of conduct that this project uses.
- I have searched the issue tracker for a feature request that matches the one I want to file, without success.
Problem description
When using the electron forge vite plugin, configuring vite for nodeIntegration: true in the renderer process requires too much of vite-specific knowledge and configuration. Further, even if one makes it work, there is no guarantee that it won't break on future updates of the plugin since it such configuration could interfering with internal assumptions of the plugin.
Proposed solution
Something like the webpack plugin does for this use case. See https://github.com/electron-forge/electron-forge-docs/blob/f83f6237a6e0018c426a1b7efddc8098eca2c01c/config/plugins/webpack.md?plain=1#L269 .
Alternatives considered
- fragile "Manual" vite configuration as described above.
- shifting a lot of what would be in the renderer into the preload script (incurs more boilerplate and complexity).
Additional information
No response
Source: electron/forge