Skip to content

Vite plugin: support nodeIntegration: true in the renderer process. #3961

Description

@hab25

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions