Replies: 4 comments 10 replies
-
For me, no. I find it confusing since a normal Vite app by |
Beta Was this translation helpful? Give feedback.
-
My response to the two quotes are at https://github.com/vitejs/vite/discussions/9442#discussioncomment-3287233 and https://github.com/vitejs/vite/discussions/9442#discussioncomment-3289064 for reference.
Perhaps it is, but then having |
Beta Was this translation helpful? Give feedback.
-
My cents are - we'd recommend providing your custom CLI for that instead. But after the object-style hooks, there is nothing preventing you from doing that if you insist. Just take your own risk and be cautious about plugin compatibility and side effects. Similar to |
Beta Was this translation helpful? Give feedback.
-
Here is a recap of today's team meeting regards on this topic (sorry we forgot to record it) The Vite team stands in the position that we don't recommend such usage.
That said, it is still technically possible to do so after #9634. Thus, we consider it non-blocking and out-of-scope of Vite core. This means we are drawing the line that we won't provide future support and guarantee on such usage. We recommend higher-level integrations to provide their own CLI to fit various needs. For example, a framework could proxy other Vite subcommands but only provide custom logic for its Thanks for bringing this discussion up. |
Beta Was this translation helpful? Give feedback.
-
Both SvelteKit and vite-plugin-ssr use a
writeBundle()
/closeBundle()
hook in order to make$ vite build
also build SSR code.Question: should Vite have built-in support for making
$ vite build
also build SSR code?From @aleclarson:
From @benmccann:
Also, I'd argue that one
vite.config.js
should correspond to one$ vite build
call: as a user, anything else seems confusing, I think.As for vite-plugin-ssr, I think it's neat to re-use Vite's CLI instead of having a vite-plugin-ssr CLI just for fixing
$ vite build
. Vite's CLI can be used seamlessly with vite-plugin-ssr which I think is neat: https://github.com/brillout/vite-plugin-ssr/blob/ff0cb6b7caebf8d797670a68aac7f761cf7e10d4/examples/vue-full/package.json#L3-L5. Actually, thanks to thewriteBundle()
trick and theconfigureServer()
hooks,vite-plugin-ssr
does not have any CLI: it just extends Vite's CLI.There is a push back from @bluwy and @antfu.
Beta Was this translation helpful? Give feedback.
All reactions