Prompt Buddy logoPrompt Buddy

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.

Import to Prompt Buddy

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

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

  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-runtimes