Prompt Buddy logoPrompt Buddy

vite · Vite Docs

Vite Vite JavaScript API

Explains how to interact with Vite programmatically using its JavaScript API to create custom build scripts, dev servers, or integration tools.

Import to Prompt Buddy

Derived skill

Files assembled from official documentation

Viewing SKILL.md

Vite Vite JavaScript API

Explains how to interact with Vite programmatically using its JavaScript API to create custom build scripts, dev servers, or integration tools.

When To Use

Use when you need to programmatically control the Vite development server, trigger builds via script, or integrate Vite into a custom build tool or environment.

Reference Files

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/vite-javascript-api-workflow-guide.mdA markdown guide detailing Vite's core JavaScript APIs including createServer, InlineConfig, ResolvedConfig, and ViteDevServer.Questions about a markdown guide detailing Vite's core JavaScript APIs including createServer, InlineConfig, ResolvedConfig, and Vite...
examples/vite-javascript-api-createserver-function-signature.textA text representation of the async createServer function signature and its return type from the Vite JavaScript API documentation.Exact payloads, commands, or snippets shown in A text representation of the async createServer function signature and its return type from the Vite JavaScript API d...
examples/vite-javascript-api-createserver-nodejs.textA JavaScript code example demonstrating how to use the createServer function from the Vite API to initialize and listen on a development server.Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to use the createServer function from the Vite API to initialize and list...
examples/vite-javascript-api-middleware-mode-nodejs.textA Node.js code example demonstrating how to use Vite in middleware mode with an existing HTTP server.Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to use Vite in middleware mode with an existing HTTP server.
examples/vite-javascript-api-vite-dev-server-interface-definition.textA TypeScript interface definition for the ViteDevServer object including its config and connect app properties.Exact payloads, commands, or snippets shown in A TypeScript interface definition for the ViteDevServer object including its config and connect app properties.
examples/vite-javascript-api-build-function.textA code example demonstrating the usage of the asynchronous build function from the Vite JavaScript API.Exact payloads, commands, or snippets shown in A code example demonstrating the usage of the asynchronous build function from the Vite JavaScript API.
examples/vite-javascript-api-build-configuration.textA JavaScript code example demonstrating how to use the Vite build function with custom root, base, and rollupOptions configurations.Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to use the Vite build function with custom root, base, and rollupOptions...
examples/vite-javascript-api-preview-function.textA code example demonstrating the usage of the async preview function from the Vite JavaScript API.Exact payloads, commands, or snippets shown in A code example demonstrating the usage of the async preview function from the Vite JavaScript API.
examples/vite-javascript-api-preview-usage.textA JavaScript code example demonstrating how to use the Vite preview API to start a local preview server with custom configuration options.Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to use the Vite preview API to start a local preview server with custom c...
examples/vite-javascript-api-preview-server-interface.textA text representation of the PreviewServer interface definition and its properties within the Vite JavaScript API.Exact payloads, commands, or snippets shown in A text representation of the PreviewServer interface definition and its properties within the Vite JavaScript API.
examples/vite-javascript-api-resolveconfig.textA JavaScript code example demonstrating the usage of the resolveConfig function from the Vite API.Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating the usage of the resolveConfig function from the Vite API.
examples/vite-javascript-api-mergeconfig.textA code example demonstrating the usage of the mergeConfig function from the Vite JavaScript API.Exact payloads, commands, or snippets shown in A code example demonstrating the usage of the mergeConfig function from the Vite JavaScript API.
examples/vite-javascript-api-defineconfig-callback.textA code example demonstrating how to use a callback function within the Vite defineConfig API to merge configurations based on the environment.Exact payloads, commands, or snippets shown in A code example demonstrating how to use a callback function within the Vite defineConfig API to merge configurations...
examples/vite-javascript-api-search-for-workspace-root.textA JavaScript implementation of the searchForWorkspaceRoot function used to locate the workspace root directory.Exact payloads, commands, or snippets shown in A JavaScript implementation of the searchForWorkspaceRoot function used to locate the workspace root directory.
examples/vite-javascript-api-loadenv-function-signature.textA text representation of the loadEnv function signature and parameters from the Vite JavaScript API documentation.Exact payloads, commands, or snippets shown in A text representation of the loadEnv function signature and parameters from the Vite JavaScript API documentation.
examples/vite-javascript-api-normalizepath.textA code example demonstrating the usage of the normalizePath function from the Vite JavaScript API.Exact payloads, commands, or snippets shown in A code example demonstrating the usage of the normalizePath function from the Vite JavaScript API.
examples/vite-javascript-api-transform-with-oxc.textAn asynchronous JavaScript function demonstrating how to use the transformWithOxc method within the Vite API.Exact payloads, commands, or snippets shown in An asynchronous JavaScript function demonstrating how to use the transformWithOxc method within the Vite API.
examples/vite-javascript-api-transformwithesbuild.textAn example demonstrating the usage of the async transformWithEsbuild function within the Vite JavaScript API.Exact payloads, commands, or snippets shown in An example demonstrating the usage of the async transformWithEsbuild function within the Vite JavaScript API.
examples/vite-javascript-api-load-config-from.textAn example demonstrating the usage of the async loadConfigFromFile function from the Vite JavaScript API.Exact payloads, commands, or snippets shown in An example demonstrating the usage of the async loadConfigFromFile function from the Vite JavaScript API.
examples/vite-javascript-api-preprocesscss-function-signature.textThe function signature and interface definition for the preprocessCSS function within the Vite JavaScript API.Exact payloads, commands, or snippets shown in The function signature and interface definition for the preprocessCSS function within the Vite JavaScript API.

What This Skill Covers

  • Are you an LLM? You can read better optimized documentation at /guide/api-javascript.md for this page in Markdown format
  • Main sections: createServer ​, InlineConfig ​, ResolvedConfig ​, ViteDevServer ​, build ​.

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