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.
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
| File | Contains | Use For |
|---|---|---|
SKILL.md | Entry point: scope, routing table, and workflow. | Start here. |
docs/vite-javascript-api-workflow-guide.md | A 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.text | A 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.text | A 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.text | A 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.text | A 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.text | A 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.text | A 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.text | A 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.text | A 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.text | A 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.text | A 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.text | A 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.text | A 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.text | A 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.text | A 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.text | A 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.text | An 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.text | An 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.text | An 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.text | The 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
- 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-javascript