cloudflare · Cloudflare Workers Docs
Workers Cloudflare Environments
Configuring and selecting specific Cloudflare environments during development and build processes using the CLOUDFLAREENV environment variable with the Vite plugin.
Derived skill
Files assembled from official documentation
Viewing SKILL.md
Workers Cloudflare Environments
Configuring and selecting specific Cloudflare environments during development and build processes using the CLOUDFLAREENV environment variable with the Vite plugin.
When To Use
Use when you need to switch between different Cloudflare environment configurations during vite build or vite dev commands or when setting up local development secrets using .dev.vars or .env files.
Reference Files
| File | Contains | Use For |
|---|---|---|
SKILL.md | Entry point: scope, routing table, and workflow. | Start here. |
docs/workers-vite-plugin-cloudflare-environments-workflow-guide.md | Documentation regarding the configuration of multiple Cloudflare environments using the Cloudflare Vite plugin. | Questions about documentation regarding the configuration of multiple Cloudflare environments using the Cloudflare Vite plugin. |
examples/workers-vite-plugin-cloudflare-environments-cloudflare-workers-vite-plug.text | A wrangler.json configuration file demonstrating how to define environment-specific variables for Cloudflare Workers using the Vite plugin. | Exact payloads, commands, or snippets shown in A wrangler.json configuration file demonstrating how to define environment-specific variables for Cloudflare Workers... |
examples/workers-vite-plugin-cloudflare-environments-cloudflare-workers-vite-plug-2.text | A wrangler.toml configuration file demonstrating how to define environment-specific variables for Cloudflare Workers using the Vite plugin. | Exact payloads, commands, or snippets shown in A wrangler.toml configuration file demonstrating how to define environment-specific variables for Cloudflare Workers... |
examples/workers-vite-plugin-cloudflare-environments-cloudflare-workers-environme.text | A wrangler.toml configuration file demonstrating how to define multiple environments for a Cloudflare Worker. | Exact payloads, commands, or snippets shown in A wrangler.toml configuration file demonstrating how to define multiple environments for a Cloudflare Worker. |
examples/workers-vite-plugin-cloudflare-environments-cloudflare-workers-vite-plug-3.text | An example text file demonstrating the format for environment variables like SECRET_KEY and APITOKEN used with the Cloudflare Workers Vite plugin. | Exact payloads, commands, or snippets shown in An example text file demonstrating the format for environment variables like SECRETKEY and APITOKEN used with the Clo... |
examples/workers-vite-plugin-cloudflare-environments-cloudflare-workers-vite-plug-4.text | A text snippet demonstrating the use of the CLOUDFLARE_ENV=staging environment variable for configuring Cloudflare Workers environments via the Vite plugin. | Exact payloads, commands, or snippets shown in A text snippet demonstrating the use of the CLOUDFLAREENV=staging environment variable for configuring Cloudflare Wor... |
examples/workers-vite-plugin-cloudflare-environments-cloudflare-workers-vite-plug-5.text | An example demonstrating how to use the CLOUDFLARE_ENV environment variable to manage different environments in a Cloudflare Workers project using the Vite plugin. | Exact payloads, commands, or snippets shown in An example demonstrating how to use the CLOUDFLAREENV environment variable to manage different environments in a Clou... |
What This Skill Covers
- A Worker config file may contain configuration for multiple Cloudflare environments. With the Cloudflare Vite plugin, you select a Cloudflare environment at...
- Main sections:
Secrets in local development,Combining Cloudflare environments and Vite modes.
Workflow
- Open the most relevant file under
docs/for the exact documented workflow and wording. - Open
schemas/files for exact structured contracts. - Open
examples/files for concrete requests, commands, snippets, and manifests. - Do not add behavior or configuration that is not present in the attached source files.
Canonical source: https://developers.cloudflare.com/workers/vite-plugin/reference/cloudflare-environments
