Prompt Buddy logoPrompt Buddy

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.

Import to Prompt Buddy

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

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/workers-vite-plugin-cloudflare-environments-workflow-guide.mdDocumentation 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.textA 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.textA 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.textA 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.textAn 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.textA 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.textAn 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

  1. Open the most relevant file under docs/ for the exact documented workflow and wording.
  2. Open schemas/ files for exact structured contracts.
  3. Open examples/ files for concrete requests, commands, snippets, and manifests.
  4. 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