Prompt Buddy logoPrompt Buddy

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.

Import to Prompt Buddy

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

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/main-vite-javascript-api-branch-workflow-guide.mdA 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.textThe 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.textA 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.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/main-vite-javascript-api-branch-vite-javascript-api-dev-server-interface.textA 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.textThe 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.textA 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.textA 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.textA 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.textThe 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.textA 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.textThe 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textAn 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.textA 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

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