Prompt Buddy logoPrompt Buddy

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.

Import to Prompt Buddy

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

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

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