vite · Vite Docs
Vite Vite Environment API for Runtimes
Explains how to implement and use the Environment API to manage different runtimes and environments within Vite.
Derived skill
Files assembled from official documentation
Viewing SKILL.md
Vite Vite Environment API for Runtimes
Explains how to implement and use the Environment API to manage different runtimes and environments within Vite.
When To Use
Use when you need to implement or configure specific runtime environments and manage how code behaves across different execution contexts in a Vite project.
Reference Files
| File | Contains | Use For |
|---|---|---|
SKILL.md | Entry point: scope, routing table, and workflow. | Start here. |
docs/vite-environment-api-for-runtimes-workflow-guide.md | A guide explaining the Vite Environment API, including environment factories, ModuleRunner, and ModuleRunnerOptions. | Questions about a guide explaining the Vite Environment API, including environment factories, ModuleRunner, and ModuleRunnerOptions. |
examples/vite-environment-api-for-runtimes-vite-environment-api-workerd-implement.text | A text-based implementation example demonstrating how to use the Vite Environment API to create a custom workerd runtime environment. | Exact payloads, commands, or snippets shown in A text-based implementation example demonstrating how to use the Vite Environment API to create a custom workerd runt... |
examples/vite-environment-api-for-runtimes-vite-environment-api-workerd-configura.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/vite-environment-api-for-runtimes-vite-environment-api-runtimes.text | A text-based example demonstrating the usage of the Vite Environment API for managing runtimes. | Exact payloads, commands, or snippets shown in A text-based example demonstrating the usage of the Vite Environment API for managing runtimes. |
examples/vite-environment-api-for-runtimes-vite-environment-api-workerd-dev-envir.text | A TypeScript implementation demonstrating how to create a custom DevEnvironment using the Vite Environment API for the workerd runtime. | Exact payloads, commands, or snippets shown in A TypeScript implementation demonstrating how to create a custom DevEnvironment using the Vite Environment API for th... |
examples/vite-environment-api-for-runtimes-vite-environment-api-module-runner-typ.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/vite-environment-api-for-runtimes-vite-environment-api-module-runner-nod.text | A JavaScript code example demonstrating how to use the ModuleRunner and createNodeImportMeta to import modules within a Vite environment runtime. | Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to use the ModuleRunner and createNodeImportMeta to import modules within... |
examples/vite-environment-api-for-runtimes-vite-environment-api-module-runner-opt.text | The TypeScript interface definition for ModuleRunnerOptions within the Vite Environment API. | Exact payloads, commands, or snippets shown in The TypeScript interface definition for ModuleRunnerOptions within the Vite Environment API. |
examples/vite-environment-api-for-runtimes-vite-environment-api-module-evaluator-.text | The TypeScript interface definition for the ModuleEvaluator within the Vite Environment API. | Exact payloads, commands, or snippets shown in The TypeScript interface definition for the ModuleEvaluator within the Vite Environment API. |
examples/vite-environment-api-for-runtimes-vite-environment-api-module-runner-tra.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/vite-environment-api-for-runtimes-vite-environment-api-module-runner-tra-2.text | A text implementation of a ModuleRunnerTransport using Node.js worker_threads to facilitate communication between the Vite environment and a runtime. | Exact payloads, commands, or snippets shown in A text implementation of a ModuleRunnerTransport using Node.js workerthreads to facilitate communication between the... |
examples/vite-environment-api-for-runtimes-vite-environment-api-worker-thread-imp.text | A JavaScript implementation demonstrating how to create a custom Vite environment using Node.js worker threads. | Exact payloads, commands, or snippets shown in A JavaScript implementation demonstrating how to create a custom Vite environment using Node.js worker threads. |
examples/vite-environment-api-for-runtimes-vite-environment-api-module-runner-nod-2.text | A JavaScript code example demonstrating how to instantiate a ModuleRunner with a custom transport for the Vite Environment API. | Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to instantiate a ModuleRunner with a custom transport for the Vite Enviro... |
examples/vite-environment-api-for-runtimes-vite-environment-api-dev-environment-i.text | A code example demonstrating how to instantiate and use the DevEnvironment class within the Vite Environment API. | Exact payloads, commands, or snippets shown in A code example demonstrating how to instantiate and use the DevEnvironment class within the Vite Environment API. |
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://vite.dev/guide/api-environment-runtimes