VuePressVuePress
  • Introduction
  • Getting Started
  • Configuration
  • Page
  • Markdown
  • Assets
  • I18n
  • Deployment
  • Theme
  • Plugin
  • Bundler
  • Migrating from v1
  • Troubleshooting
  • Core

    • CLI
    • Config
    • Frontmatter
    • Built-in Components
    • Plugin API
    • Theme API
    • Client API
    • Node API
  • Bundlers

    • Vite
    • Webpack
  • Ecosystem

    • Default Theme
    • Plugins
  • Advanced

    • Architecture
    • Writing a Plugin
    • Writing a Theme
    • Cookbook
  • Resources

    • Ecosystem
    • MarketPlace
    • Contributing Guide
  • Changelog
  • v1.x
  • v0.x
  • English
  • 简体中文
GitHub
  • Introduction
  • Getting Started
  • Configuration
  • Page
  • Markdown
  • Assets
  • I18n
  • Deployment
  • Theme
  • Plugin
  • Bundler
  • Migrating from v1
  • Troubleshooting
  • Core

    • CLI
    • Config
    • Frontmatter
    • Built-in Components
    • Plugin API
    • Theme API
    • Client API
    • Node API
  • Bundlers

    • Vite
    • Webpack
  • Ecosystem

    • Default Theme
    • Plugins
  • Advanced

    • Architecture
    • Writing a Plugin
    • Writing a Theme
    • Cookbook
  • Resources

    • Ecosystem
    • MarketPlace
    • Contributing Guide
  • Changelog
  • v1.x
  • v0.x
  • English
  • 简体中文
GitHub
  • Core

    • Command Line Interface
    • Config
    • Frontmatter
    • Built-in Components
    • Plugin API
    • Theme API
    • Client API
    • Node API
  • Bundlers

    • Vite
    • Webpack
  • Ecosystem

    • Default Theme
    • Plugins

Vite

@vuepress/bundler-vite

Vite bundler is provided by @vuepress/bundler-vite package.

Usage

Install the bundler package:

npm i -D @vuepress/bundler-vite@next

Specify the bundler option in your config file:

.vuepress/config.ts
import { viteBundler } from '@vuepress/bundler-vite'
import { defineUserConfig } from 'vuepress'

export default defineUserConfig({
  bundler: viteBundler({
    viteOptions: {},
    vuePluginOptions: {},
  }),
})

Exports

viteBundler

  • Type: (options?: ViteBundlerOptions) => Bundler

  • Details:

    Create a vite bundler instance.

viteMergeConfig

  • Type: (configA: ViteUserConfig, configB: ViteUserConfig) => ViteUserConfig

  • Details:

    Merge two vite config objects, provided by vite's mergeConfig JavaScript API.

Options

viteOptions

  • Details:

    Accepts all options of Vite.

  • Also see:

    • Vite > Config

vuePluginOptions

  • Details:

    Accepts all options of @vitejs/plugin-vue.

  • Also see:

    • Vite > Plugins > Official Plugins

configureVite

  • Type: (config: ViteUserConfig, isServer: boolean, isBuild: boolean) => ViteUserConfig | void

  • Details:

    Edit the internal vite config.

    This option accepts a function that will receive a vite config object as the 1st argument, an isServer flag as the 2nd argument and an isBuild flag as the 3rd argument. You can either mutate the config directly, or return an object to replace the vite config object.

Edit this page on GitHub
Last Updated: 7/23/26, 10:57 AM
Contributors: meteorlxy, Mister-Hope, Xinyu Liu
Next
Webpack