vite · Vite Docs
JavaScript API | Vite (main branch)
Explains how to interact with Vite programmatically using its JavaScript API, including creating dev servers and managing build processes.
Derived skill
Files assembled from official documentation
Viewing SKILL.md
JavaScript API | Vite (main branch)
Explains how to interact with Vite programmatically using its JavaScript API, including creating dev servers and managing build processes.
When To Use
Use when you need to programmatically create a Vite development server or trigger a build process within a custom Node.js application or tool.
Reference Files
| File | Contains | Use For |
|---|---|---|
SKILL.md | Entry point: scope, routing table, and workflow. | Start here. |
docs/main-vite-javascript-api-branch-workflow-guide.md | A technical reference guide detailing Vite's core JavaScript APIs including createServer, InlineConfig, ResolvedConfig, and ViteDevServer. | Questions about a technical reference guide detailing Vite's core JavaScript APIs including createServer, InlineConfig, ResolvedConfi... |
examples/main-vite-javascript-api-branch-vite-javascript-api-createserver-signatu.text | The function signature and type definition for the createServer asynchronous function in the Vite JavaScript API. | Exact payloads, commands, or snippets shown in The function signature and type definition for the createServer asynchronous function in the Vite JavaScript API. |
examples/main-vite-javascript-api-branch-vite-javascript-api-createserver.text | A JavaScript code example demonstrating how to use the createServer function to initialize and listen on a Vite development server. | Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to use the createServer function to initialize and listen on a Vite devel... |
examples/main-vite-javascript-api-branch-vite-javascript-api-middleware-mode-node.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/main-vite-javascript-api-branch-vite-javascript-api-dev-server-interface.text | A text representation of the ViteDevServer interface and its associated properties from the Vite JavaScript API documentation. | Exact payloads, commands, or snippets shown in A text representation of the ViteDevServer interface and its associated properties from the Vite JavaScript API docum... |
examples/main-vite-javascript-api-branch-vite-javascript-api-build-function-signa.text | The asynchronous build function signature and parameter definitions for the Vite JavaScript API. | Exact payloads, commands, or snippets shown in The asynchronous build function signature and parameter definitions for the Vite JavaScript API. |
examples/main-vite-javascript-api-branch-vite-javascript-api-build-function.text | A JavaScript code example demonstrating the usage of the Vite build function with configuration options like root, base, and rollupOptions. | Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating the usage of the Vite build function with configuration options like root, ba... |
examples/main-vite-javascript-api-branch-vite-javascript-api-preview-function-sig.text | A text representation of the async preview function signature and its InlineConfig parameter from the Vite JavaScript API documentation. | Exact payloads, commands, or snippets shown in A text representation of the async preview function signature and its InlineConfig parameter from the Vite JavaScript... |
examples/main-vite-javascript-api-branch-vite-javascript-api-preview-usage.text | A JavaScript code example demonstrating how to import and invoke the Vite preview function with configuration options. | Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to import and invoke the Vite preview function with configuration options. |
examples/main-vite-javascript-api-branch-vite-javascript-api-preview-server-inter.text | The TypeScript interface definition for the PreviewServer object within the Vite JavaScript API. | Exact payloads, commands, or snippets shown in The TypeScript interface definition for the PreviewServer object within the Vite JavaScript API. |
examples/main-vite-javascript-api-branch-vite-javascript-api-resolveconfig.text | A code example demonstrating the usage and signature of the async resolveConfig function from the Vite JavaScript API. | Exact payloads, commands, or snippets shown in A code example demonstrating the usage and signature of the async resolveConfig function from the Vite JavaScript API. |
examples/main-vite-javascript-api-branch-vite-javascript-api-mergeconfig-function.text | The function signature and parameter definitions for the mergeConfig utility in the Vite JavaScript API. | Exact payloads, commands, or snippets shown in The function signature and parameter definitions for the mergeConfig utility in the Vite JavaScript API. |
examples/main-vite-javascript-api-branch-vite-javascript-api-defineconfig.text | A code example demonstrating the usage of the defineConfig function within the Vite JavaScript API. | Exact payloads, commands, or snippets shown in A code example demonstrating the usage of the defineConfig function within the Vite JavaScript API. |
examples/main-vite-javascript-api-branch-vite-javascript-api-searchforworkspacero.text | A JavaScript implementation of the searchForWorkspaceRoot function from the Vite API documentation. | Exact payloads, commands, or snippets shown in A JavaScript implementation of the searchForWorkspaceRoot function from the Vite API documentation. |
examples/main-vite-javascript-api-branch-vite-javascript-api-loadenv-function-sig.text | A text representation of the loadEnv function signature and parameter definitions from the Vite JavaScript API documentation. | Exact payloads, commands, or snippets shown in A text representation of the loadEnv function signature and parameter definitions from the Vite JavaScript API docume... |
examples/main-vite-javascript-api-branch-vite-javascript-api-normalizepath-functi.text | A text representation of the normalizePath function signature from the Vite JavaScript API documentation. | Exact payloads, commands, or snippets shown in A text representation of the normalizePath function signature from the Vite JavaScript API documentation. |
examples/main-vite-javascript-api-branch-vite-javascript-api-transformwithoxc.text | A JavaScript code example demonstrating the usage of the transformWithOxc function within the Vite API. | Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating the usage of the transformWithOxc function within the Vite API. |
examples/main-vite-javascript-api-branch-vite-javascript-api-transformwithesbuild.text | A code example demonstrating the usage of the transformWithEsbuild function from the Vite JavaScript API. | Exact payloads, commands, or snippets shown in A code example demonstrating the usage of the transformWithEsbuild function from the Vite JavaScript API. |
examples/main-vite-javascript-api-branch-vite-javascript-api-loadconfigfromfile.text | An example demonstrating the usage of the loadConfigFromFile function from the Vite JavaScript API. | Exact payloads, commands, or snippets shown in An example demonstrating the usage of the loadConfigFromFile function from the Vite JavaScript API. |
examples/main-vite-javascript-api-branch-vite-javascript-api-preprocesscss-interf.text | A TypeScript interface definition and function signature for the preprocessCSS method within the Vite JavaScript API. | Exact payloads, commands, or snippets shown in A TypeScript interface definition and function signature for the preprocessCSS method 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://main.vite.dev/guide/api-javascript