WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
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
{{ message }}
This repository was archived by the owner on Mar 11, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+8-3Lines changed: 8 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -395,9 +395,14 @@ This is because the environment name is automatically appended to the top-level
395
395
> The default Vite environment name for a Worker is always the top-level name.
396
396
> This enables you to reference the Worker consistently in your Vite config when using multiple environments.
397
397
398
-
Running `vite dev` or `vite build` without providing `CLOUDFLARE_ENV` will use the default top-level environment.
399
-
The value of `MY_VAR` will therefore be `'Top-level var'`.
400
-
As Worker environments are applied at dev and build time, specifying `CLOUDFLARE_ENV` when running `vite preview` or `wrangler deploy` will have no effect.
398
+
Worker environments can also be used in development.
399
+
For example, you could run `CLOUDFLARE_ENV=development vite dev`.
400
+
It is common to use the default top-level environment as the development environment and then add additional environments as necessary.
401
+
402
+
> [!NOTE]
403
+
> Running `vite dev` or `vite build` without providing `CLOUDFLARE_ENV` will use the default top-level environment.
404
+
> The value of `MY_VAR` will therefore be `'Top-level var'`.
405
+
> As Worker environments are applied at dev and build time, specifying `CLOUDFLARE_ENV` when running `vite preview` or `wrangler deploy` will have no effect.
0 commit comments