vite · Vite Docs
Environment API | Vite (main branch)
Explains how to use the Vite Environment API to manage different execution contexts and handle environment-specific logic during development and build processes.
Derived skill
Files assembled from official documentation
Viewing SKILL.md
Environment API | Vite (main branch)
Explains how to use the Vite Environment API to manage different execution contexts and handle environment-specific logic during development and build processes.
When To Use
Use when you need to implement custom environment handling or manage different execution contexts within a Vite-based project.
Reference Files
| File | Contains | Use For |
|---|---|---|
SKILL.md | Entry point: scope, routing table, and workflow. | Start here. |
docs/main-vite-environment-api-branch-workflow-guide.md | A guide explaining the Vite Environment API, including configuration, custom environment instances, and the transition between build and development environments. | Questions about a guide explaining the Vite Environment API, including configuration, custom environment instances, and the transitio... |
examples/main-vite-environment-api-branch-vite-environment-api-defineconfig.text | A configuration example demonstrating the use of the defineConfig function within the Vite Environment API. | Exact payloads, commands, or snippets shown in A configuration example demonstrating the use of the defineConfig function within the Vite Environment API. |
examples/main-vite-environment-api-branch-vite-environment-api-config.text | A configuration object demonstrating the use of the Vite Environment API to define build and optimization settings for different environments. | Exact payloads, commands, or snippets shown in A configuration object demonstrating the use of the Vite Environment API to define build and optimization settings fo... |
examples/main-vite-environment-api-branch-vite-environment-options-interface-defi.text | The TypeScript interface definition for EnvironmentOptions including define, resolve, optimizeDeps, consumer, dev, and build properties. | Exact payloads, commands, or snippets shown in The TypeScript interface definition for EnvironmentOptions including define, resolve, optimizeDeps, consumer, dev, an... |
examples/main-vite-environment-api-branch-vite-environment-api-userconfig-interfa.text | A TypeScript interface definition showing how UserConfig extends EnvironmentOptions to include an environments record. | Exact payloads, commands, or snippets shown in A TypeScript interface definition showing how UserConfig extends EnvironmentOptions to include an environments record. |
examples/main-vite-environment-api-branch-vite-environment-api-custom-environment.text | A code example demonstrating how to use the customEnvironment function to configure different build output directories for multiple environments in Vite. | Exact payloads, commands, or snippets shown in A code example demonstrating how to use the customEnvironment function to configure different build output directorie... |
What This Skill Covers
- Are you an LLM? You can read better optimized documentation at /guide/api-environment.md for this page in Markdown format
- Main sections:
Formalizing Environments ,Closing the Gap Between Build and Dev ,Environments Configuration ,Custom Environment Instances ,Backward Compatibility .
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://main.vite.dev/guide/api-environment