Prompt Buddy logoPrompt Buddy

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.

Import to Prompt Buddy

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

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/vite-environment-api-for-runtimes-workflow-guide.mdA 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.textA 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.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/vite-environment-api-for-runtimes-vite-environment-api-runtimes.textA 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.textA 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.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/vite-environment-api-for-runtimes-vite-environment-api-module-runner-nod.textA 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.textThe 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-.textThe 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.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/vite-environment-api-for-runtimes-vite-environment-api-module-runner-tra-2.textA 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.textA 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.textA 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.textA 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

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