Skip to content

feat(plugin-vite): configurable esm + cjs options#4184

Open
erickzhao wants to merge 6 commits intonextfrom
esm-cjs-interop-vite-plugin
Open

feat(plugin-vite): configurable esm + cjs options#4184
erickzhao wants to merge 6 commits intonextfrom
esm-cjs-interop-vite-plugin

Conversation

@erickzhao
Copy link
Member

@erickzhao erickzhao commented Mar 20, 2026

Closes #4016

Automatically inferring based on type: module in package.json limits flexibility for apps that want to ship CommonJS within their Electron app.

ESM in Electron has its own set of limitations and caveats, and CommonJS is still the standard way to ship your JavaScript app bundle.

This PR takes a different approach by adding type: module/commonjs as an option to the Vite plugin, and modifying the bundle output in that manner as well.

@erickzhao erickzhao added the next label Mar 24, 2026
@erickzhao erickzhao marked this pull request as ready for review March 24, 2026 19:51
@erickzhao erickzhao requested a review from a team as a code owner March 24, 2026 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant