vite · Vite Docs
Environment API for Runtimes | Vite (main branch)
Explains how to implement and use the Environment API to manage different runtimes and environments within a Vite project.
Derived skill
Files assembled from official documentation
Viewing SKILL.md
Environment API for Runtimes | Vite (main branch)
Explains how to implement and use the Environment API to manage different runtimes and environments within a Vite project.
When To Use
Use when you need to implement or configure different runtimes and environment-specific behaviors within a Vite-based development or build process.
Reference Files
| File | Contains | Use For |
|---|---|---|
SKILL.md | Entry point: scope, routing table, and workflow. | Start here. |
docs/main-vite-environment-api-for-runtimes-branch-workflow-guide.md | Documentation describing the Vite Environment API, including environment factories, ModuleRunner, and ModuleRunnerOptions. | Questions about documentation describing the Vite Environment API, including environment factories, ModuleRunner, and ModuleRunnerOpt... |
examples/main-vite-environment-api-for-runtimes-branch-vite-environment-api-worke.text | A TypeScript code example demonstrating how to implement the createWorkerdEnvironment function using the Vite Environment API. | Exact payloads, commands, or snippets shown in A TypeScript code example demonstrating how to implement the createWorkerdEnvironment function using the Vite Environ... |
examples/main-vite-environment-api-for-runtimes-branch-vite-environment-api-worke-2.text | A configuration example demonstrating how to use createWorkerdEnvironment to define ssr and rsc environments within the Vite Environment API. | Exact payloads, commands, or snippets shown in A configuration example demonstrating how to use createWorkerdEnvironment to define ssr and rsc environments within t... |
examples/main-vite-environment-api-for-runtimes-branch-vite-environment-api-runti.text | A code example demonstrating how to access the SSR environment via the Vite server environments API. | Exact payloads, commands, or snippets shown in A code example demonstrating how to access the SSR environment via the Vite server environments API. |
examples/main-vite-environment-api-for-runtimes-branch-vite-environment-api-worke-3.text | A TypeScript code example demonstrating how to implement a custom DevEnvironment using the Vite Environment API for a workerd runtime. | Exact payloads, commands, or snippets shown in A TypeScript code example demonstrating how to implement a custom DevEnvironment using the Vite Environment API for a... |
examples/main-vite-environment-api-for-runtimes-branch-vite-environment-api-modul.text | A TypeScript implementation demonstrating the use of the ModuleRunner class within the Vite Environment API. | Exact payloads, commands, or snippets shown in A TypeScript implementation demonstrating the use of the ModuleRunner class within the Vite Environment API. |
examples/main-vite-environment-api-for-runtimes-branch-vite-environment-api-modul-2.text | A JavaScript code example demonstrating how to use the ModuleRunner and ESModulesEvaluator within the Vite Environment API. | Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to use the ModuleRunner and ESModulesEvaluator within the Vite Environmen... |
examples/main-vite-environment-api-for-runtimes-branch-vite-environment-api-modul-3.text | A TypeScript interface definition for ModuleRunnerOptions within the Vite Environment API. | Exact payloads, commands, or snippets shown in A TypeScript interface definition for ModuleRunnerOptions within the Vite Environment API. |
examples/main-vite-environment-api-for-runtimes-branch-vite-environment-api-modul-4.text | The TypeScript interface definition for ModuleEvaluator within the Vite Environment API. | Exact payloads, commands, or snippets shown in The TypeScript interface definition for ModuleEvaluator within the Vite Environment API. |
examples/main-vite-environment-api-for-runtimes-branch-vite-environment-api-modul-5.text | The TypeScript interface definition for ModuleRunnerTransport within the Vite Environment API. | Exact payloads, commands, or snippets shown in The TypeScript interface definition for ModuleRunnerTransport within the Vite Environment API. |
examples/main-vite-environment-api-for-runtimes-branch-vite-environment-api-modul-6.text | A text example demonstrating the implementation of a ModuleRunnerTransport using node:worker_threads for the Vite Environment API. | Exact payloads, commands, or snippets shown in A text example demonstrating the implementation of a ModuleRunnerTransport using node:workerthreads for the Vite Envi... |
examples/main-vite-environment-api-for-runtimes-branch-vite-environment-api-runti-2.text | A JavaScript implementation demonstrating how to create a custom worker environment using the Vite Environment API. | Exact payloads, commands, or snippets shown in A JavaScript implementation demonstrating how to create a custom worker environment using the Vite Environment API. |
examples/main-vite-environment-api-for-runtimes-branch-vite-module-runner-esmodul.text | A JavaScript code example demonstrating how to instantiate a ModuleRunner with an ESModulesEvaluator and a custom fetch-based transport. | Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to instantiate a ModuleRunner with an ESModulesEvaluator and a custom fet... |
examples/main-vite-environment-api-for-runtimes-branch-vite-environment-api-dev-e.text | A code example demonstrating how to instantiate a custom DevEnvironment and handle hot module replacement requests using the Vite Environment API. | Exact payloads, commands, or snippets shown in A code example demonstrating how to instantiate a custom DevEnvironment and handle hot module replacement requests us... |
What This Skill Covers
- Are you an LLM? You can read better optimized documentation at /guide/api-environment-runtimes.md for this page in Markdown format
- Main sections:
Environment Factories ,Creating a New Environment Factory ,ModuleRunner ,ModuleRunnerOptions ,ModuleEvaluator .
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-runtimes