cloudflare · Cloudflare Workers Docs
Workers Vite Environments
Explains how the Cloudflare Vite plugin utilizes the Vite Environment API to integrate Workers with Vite, including how to configure environment-specific settings and how to assign Workers to the ssr environment for f...
Derived skill
Files assembled from official documentation
Viewing SKILL.md
Workers Vite Environments
Explains how the Cloudflare Vite plugin utilizes the Vite Environment API to integrate Workers with Vite, including how to configure environment-specific settings and how to assign Workers to the ssr environment for f...
When To Use
Use when you need to configure environment-specific constants in vite.config.ts or when integrating full-stack frameworks like React Router v7 with the Cloudflare Workers runtime via Vite.
Reference Files
| File | Contains | Use For |
|---|---|---|
SKILL.md | Entry point: scope, routing table, and workflow. | Start here. |
docs/workers-vite-plugin-environments-workflow-guide.md | Documentation explaining how the Vite Environment API integrates the Cloudflare Vite plugin with the Workers runtime. | Questions about documentation explaining how the Vite Environment API integrates the Cloudflare Vite plugin with the Workers runtime. |
examples/workers-vite-plugin-environments-cloudflare-workers-vite-environments-co.text | A configuration file demonstrating how to define environment variables within a Cloudflare Workers Vite plugin setup. | Exact payloads, commands, or snippets shown in A configuration file demonstrating how to define environment variables within a Cloudflare Workers Vite plugin setup. |
examples/workers-vite-plugin-environments-cloudflare-workers-vite-environments-wr.text | A wrangler.toml configuration file demonstrating the use of the vite-plugin-environments schema and compatibility date settings. | Exact payloads, commands, or snippets shown in A wrangler.toml configuration file demonstrating the use of the vite-plugin-environments schema and compatibility dat... |
examples/workers-vite-plugin-environments-cloudflare-workers-vite-environments-co-2.text | A vite configuration file demonstrating how to define custom environments and global constants using the cloudflare workers vite plugin. | Exact payloads, commands, or snippets shown in A vite configuration file demonstrating how to define custom environments and global constants using the cloudflare w... |
examples/workers-vite-plugin-environments-cloudflare-workers-vite-plugin-environm.text | A Vite configuration file demonstrating how to use the cloudflare plugin with a specific viteEnvironment setting. | Exact payloads, commands, or snippets shown in A Vite configuration file demonstrating how to use the cloudflare plugin with a specific viteEnvironment setting. |
What This Skill Covers
- The Vite Environment API ↗, released in Vite 6, is the key feature that enables the Cloudflare Vite plugin to integrate Vite directly with the Workers runtim...
- Main sections:
Default behavior,Environment configuration,Full-stack frameworks.
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/vite-environments
