vite · Vite Docs
Vite Vite Using Environment Instances
Explains how to use environment instances in Vite to manage different variables and configurations for different environments like development, preview, or production.
Derived skill
Files assembled from official documentation
Viewing SKILL.md
Vite Vite Using Environment Instances
Explains how to use environment instances in Vite to manage different variables and configurations for different environments like development, preview, or production.
When To Use
Use when you need to implement environment-specific logic or access different sets of variables based on the current execution context in a Vite project.
Reference Files
| File | Contains | Use For |
|---|---|---|
SKILL.md | Entry point: scope, routing table, and workflow. | Start here. |
docs/vite-using-environment-instances-workflow-guide.md | A guide explaining how to access and use Vite environment instances, including the DevEnvironment class and separate module graphs. | Questions about a guide explaining how to access and use Vite environment instances, including the DevEnvironment class and separate... |
examples/vite-using-environment-instances-vite-environment-instances-javascript.text | A JavaScript code example demonstrating how to access and interact with client and SSR environment instances using the Vite server API. | Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to access and interact with client and SSR environment instances using th... |
examples/vite-using-environment-instances-vite-environment-instances-dev-environm.text | A text representation of the DevEnvironment class structure and its properties within the Vite API. | Exact payloads, commands, or snippets shown in A text representation of the DevEnvironment class structure and its properties within the Vite API. |
examples/vite-using-environment-instances-vite-dev-environment-context-interface-.text | A TypeScript interface definition for the DevEnvironmentContext object within the Vite environment API. | Exact payloads, commands, or snippets shown in A TypeScript interface definition for the DevEnvironmentContext object within the Vite environment API. |
examples/vite-using-environment-instances-vite-environment-instances-transform-re.text | A text representation of the TransformResult interface definition used within Vite environment instances. | Exact payloads, commands, or snippets shown in A text representation of the TransformResult interface definition used within Vite environment instances. |
examples/vite-using-environment-instances-vite-environment-module-node-class-defi.text | A text representation of the EnvironmentModuleNode class structure used within Vite's environment instances API. | Exact payloads, commands, or snippets shown in A text representation of the EnvironmentModuleNode class structure used within Vite's environment instances API. |
examples/vite-using-environment-instances-vite-environment-module-graph-class-imp.text | A TypeScript implementation of the EnvironmentModuleGraph class used for managing module maps within Vite environment instances. | Exact payloads, commands, or snippets shown in A TypeScript implementation of the EnvironmentModuleGraph class used for managing module maps within Vite environment... |
examples/vite-using-environment-instances-vite-environment-instances-cached-fetch.text | A TypeScript interface definition for CachedFetchResult used to track module cache status within Vite environment instances. | Exact payloads, commands, or snippets shown in A TypeScript interface definition for CachedFetchResult used to track module cache status within Vite environment ins... |
examples/vite-using-environment-instances-vite-environment-api-external-fetch-res.text | A TypeScript interface definition for ExternalFetchResult used within the Vite environment API. | Exact payloads, commands, or snippets shown in A TypeScript interface definition for ExternalFetchResult used within the Vite environment API. |
examples/vite-using-environment-instances-vite-environment-instances-vitefetchres.text | The TypeScript interface definition for ViteFetchResult used within Vite environment instances. | Exact payloads, commands, or snippets shown in The TypeScript interface definition for ViteFetchResult used within Vite environment instances. |
What This Skill Covers
- Are you an LLM? You can read better optimized documentation at /guide/api-environment-instances.md for this page in Markdown format
- Main sections:
Accessing the Environments ,DevEnvironment class ,Separate Module Graphs .
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://vite.dev/guide/api-environment-instances