Environment API - Preview Environments #18614
jamesopstad
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The Environment API currently allows creating environments for dev and build but not for preview. Supporting environments when running
vite preview
would enable the build output to be previewed in the appropriate runtime (and in Cloudflare's case with the appropriate bindings etc.). This would also have the benefit of making it more straightforward to test build output.Usage
environments
property onPreviewServer
in theconfigurePreviewServer
hook. This is equivalent to accessing dev environments in theconfigureServer
hook.PreviewEnvironment
. This should have a similar interface toDevEnvironment
(includingdispatchFetch
if that is agreed upon).API
preview
option toEnvironmentOptions
withPreviewEnvironmentOptions
type:PreviewEnvironment
class:environments
property toPreviewServer
Questions
PreviewEnvironmentOptions
?ResolvedConfig
?Beta Was this translation helpful? Give feedback.
All reactions