Skip to content

feat(vite): support nodeIntegration renderer builds - #4258

Closed
rafael81 wants to merge 1 commit into
electron:mainfrom
rafael81:feat/vite-node-integration-renderer
Closed

rafael81 wants to merge 1 commit into
electron:mainfrom
rafael81:feat/vite-node-integration-renderer

Conversation

@rafael81

Copy link
Copy Markdown

Refs #3961

Summary

  • add a nodeIntegration option to @electron-forge/plugin-vite renderer entries
  • when enabled, externalize Electron/Node built-ins for renderer builds and resolve packages with Node-oriented conditions/main fields
  • document the new renderer option in the Vite plugin README
  • add ViteConfig coverage for the default renderer path and the new nodeIntegration: true path

Validation

$ npm exec --yes @yarnpkg/cli-dist@4.10.3 -- prettier --write packages/plugin/vite/src/Config.ts packages/plugin/vite/src/config/vite.renderer.config.ts packages/plugin/vite/spec/ViteConfig.spec.ts packages/plugin/vite/README.md --experimental-cli
# passed

$ npm exec --yes @yarnpkg/cli-dist@4.10.3 -- vitest run --project fast packages/plugin/vite/spec/ViteConfig.spec.ts
Test Files  1 passed (1)
Tests  4 passed (4)

$ npm exec --yes @yarnpkg/cli-dist@4.10.3 -- tsc -b packages/plugin/vite
# passed

This PR was prepared with AI assistance and manually reviewed before submission.

Copy link
Copy Markdown
Member

Thanks for this. #4317 builds directly on this PR, keeps the renderer-level nodeIntegration API, and credits you as co-author, while also handling the bare ESM imports that externalization alone leaves behind. Closing this one so the discussion can continue in #4317.


Generated by Claude Code

@erickzhao erickzhao closed this Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants