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
But from looking at the code and using the plugin, it always returns a single plugin object for Vite—never an array. This can be confusing for TypeScript users, since there isn’t any case (at least documented or in the code) where you’d get an array.
As a reference, in unplugin-vue-components, the Vite plugin is typed more strictly as just a single plugin:
If there’s any advanced use case where an array could actually be returned, it would be great to document that! Otherwise, maybe the type could be updated to match the real behavior.
Describe the bug
I noticed that the type definition for the Vite plugin export is currently:
Which results in the following built
.d.ts
:But from looking at the code and using the plugin, it always returns a single plugin object for Vite—never an array. This can be confusing for TypeScript users, since there isn’t any case (at least documented or in the code) where you’d get an array.
As a reference, in unplugin-vue-components, the Vite plugin is typed more strictly as just a single plugin:
If there’s any advanced use case where an array could actually be returned, it would be great to document that! Otherwise, maybe the type could be updated to match the real behavior.
Thanks for your work on this project!
Reproduction
https://stackblitz.com/edit/vitejs-vite-c4tcpscb?file=vite.config.ts&view=editor
System Info
Used Package Manager
npm
Validations
The text was updated successfully, but these errors were encountered: