You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I write a plugin for Vite, using a default export syntax export default myPlugin.
And I built it with esbuild. See plugin folder in the reproduction sandbox.
Then I load the plugin into my vite.config.js and run vite build. I got error:
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
There's an extra (for this case) default wrapper when transpiling from ESM to CJS. It's by-designed for esbuild for now, see evanw/esbuild#2026 (comment). You can remove the type: module or use a named export instead or ship a pure ESM/dual pkg.
Describe the bug
I write a plugin for Vite, using a default export syntax
export default myPlugin
.And I built it with esbuild. See
plugin
folder in the reproduction sandbox.Then I load the plugin into my
vite.config.js
and runvite build
. I got error:Reproduction
https://stackblitz.com/edit/vitejs-vite-k7eufn
Steps to reproduce
No response
System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: