Prompt Buddy logoPrompt Buddy

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.

Import to Prompt Buddy

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

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/vite-using-environment-instances-workflow-guide.mdA 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.textA 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.textA 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-.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textThe 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

  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://vite.dev/guide/api-environment-instances