Skip to content

feat(plugin-vite): upgrade vite to version 8.0.0#4167

Open
0xlau wants to merge 4 commits intoelectron:nextfrom
0xlau:vite/upgrade-v8
Open

feat(plugin-vite): upgrade vite to version 8.0.0#4167
0xlau wants to merge 4 commits intoelectron:nextfrom
0xlau:vite/upgrade-v8

Conversation

@0xlau
Copy link
Copy Markdown

@0xlau 0xlau commented Mar 15, 2026

close #4166

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project follows, as appropriate.
  • The changes are appropriately documented (if applicable).
  • The changes have sufficient test coverage (if applicable).
  • The testsuite passes successfully on my local machine (if applicable).

Summary

This PR updates @electron-forge/plugin-vite to support Vite 8.

Electron Forge next currently uses Vite 7, while Vite 8 has already been released. This change updates the plugin so projects using Electron Forge can adopt the latest Vite version.

Changes

  • update Vite dependency to v8
  • adjust code to handle breaking changes between Vite 7 → Vite 8
  • ensure the plugin continues to work with the current Electron Forge build pipeline

Testing

Tested with a local Electron Forge project using @electron-forge/plugin-vite and Vite 8.
Build, dev server, and renderer reload all work as expected.

@0xlau 0xlau requested a review from a team as a code owner March 15, 2026 11:44
@socket-security
Copy link
Copy Markdown

socket-security bot commented Mar 15, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedvite@​8.0.0941008299100

View full report

@socket-security
Copy link
Copy Markdown

socket-security bot commented Mar 15, 2026

All alerts resolved. Learn more about Socket for GitHub.

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

Ignoring alerts on:

  • vite@8.0.0

View full report

@0xlau
Copy link
Copy Markdown
Author

0xlau commented Mar 15, 2026

Caution

Review the following alerts detected in dependencies.

According to your organization's Security Policy, you must resolve all "Block" alerts before proceeding. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Block High
Obfuscated code: npm vite is 91.0% likely obfuscated
Confidence: 0.91

Location: Package overview

From: package.jsonnpm/vite@8.0.0

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review
the linked package source code to understand the potential risk. Ensure the
package is not malicious before proceeding. If you're unsure how to proceed,
reach out to your security team or ask the Socket team for help at
support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

_Mark the package as acceptable risk_. To ignore this alert only
in this pull request, reply with the comment
`@SocketSecurity ignore npm/vite@8.0.0`. You can
also ignore all packages with `@SocketSecurity ignore-all`.
To ignore an alert for all future pull requests, use Socket's Dashboard to
change the [triage state of this alert](https://socket.dev/dashboard/org/electron-conjk/diff-scan/b16d3784-d451-4ab9-96ac-ee759f6a1a1d/alert/QACwIJpkJ4G7yTQSBEZd7r_CRsKnJkVfKAXZ4cAmFGbY).

View full report

@SocketSecurity ignore npm/vite@8.0.0

@erickzhao
Copy link
Copy Markdown
Member

@SocketSecurity ignore npm/vite@8.0.0

const contents = fs.readFileSync(outFile, 'utf8');
// MAIN_WINDOW_VITE_NAME should be statically replaced with "main_window"
expect(contents).toContain('"main_window"');
expect(contents).toMatch(/["'`]main_window["'`]/);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this map to some breaking change in Vite 7 -> 8?

@median-dxz
Copy link
Copy Markdown

median-dxz commented Mar 24, 2026

Hi, I'm using the latest stable version of Electron Forge (v7.11.1). After I updated Vite to v8, I encountered a warning when running my application:

 WARN  inlineDynamicImports option is deprecated, please use codeSplitting: false instead.

I guess we need to adjust the inlineDynamicImports configuration?

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.

3 participants