Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ export default {

## Multiple environments with `.env` files

You may be using [Cloudflare Environments](/workers/wrangler/environments/) to deploy different versions of a Worker with distinct environment variables. For instance, you may have a production and staging environment.

To set different environment variables for each Cloudflare Environment, create files named `.env.<environment-name>`.
If your Worker defines multiple [environments](/workers/wrangler/environments/), you can set different variables for each environment (ex: production or staging) by creating files named `.env.<environment-name>`.

When you use `wrangler <command> --env <environment-name>` or `CLOUDFLARE_ENV=<environment-name> vite dev`, the corresponding environment-specific file will also be loaded and merged with the `.env` file.

Expand Down