Skip to content

Commit 21eb4ad

Browse files
update vite-plugin page
1 parent c7e1c03 commit 21eb4ad

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/content/docs/workers/vite-plugin/reference/cloudflare-environments.mdx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ sidebar:
66
description: Using Cloudflare environments with the Vite plugin
77
---
88

9-
import { PackageManagers, WranglerConfig } from "~/components";
9+
import { PackageManagers, Render, WranglerConfig } from "~/components";
1010

1111
A Worker config file may contain configuration for multiple [Cloudflare environments](/workers/wrangler/environments/).
1212
With the Cloudflare Vite plugin, you select a Cloudflare environment at dev or build time by providing the `CLOUDFLARE_ENV` environment variable.
@@ -32,7 +32,7 @@ vars = { MY_VAR = "Production var" }
3232

3333
If you run `CLOUDFLARE_ENV=production vite build` then the output `wrangler.json` file generated by the build will be a flattened configuration for the 'production' Cloudflare environment, as shown in the following example:
3434

35-
```json title=wrangler.json
35+
```json title=dist/wrangler.json
3636
{
3737
"name": "my-worker",
3838
"compatibility_date": "2025-04-03",
@@ -59,6 +59,10 @@ Running `vite dev` or `vite build` without providing `CLOUDFLARE_ENV` will use t
5959
As Cloudflare environments are applied at dev and build time, specifying `CLOUDFLARE_ENV` when running `vite preview` or `wrangler deploy` will have no effect.
6060
:::
6161

62+
## Secrets in local development
63+
64+
<Render file="secrets-in-dev" />
65+
6266
## Combining Cloudflare environments and Vite modes
6367

6468
You may wish to combine the concepts of [Cloudflare environments](/workers/wrangler/environments/) and [Vite modes](https://vite.dev/guide/env-and-mode.html#modes).

0 commit comments

Comments
 (0)