Vite
Vite bundler is provided by @vuepress/bundler-vite package.
Usage
Install the bundler package:
npm i -D @vuepress/bundler-vite@nextSpecify the bundler option in your config file:
import { viteBundler } from '@vuepress/bundler-vite'
import { defineUserConfig } from 'vuepress'
export default defineUserConfig({
bundler: viteBundler({
viteOptions: {},
vuePluginOptions: {},
}),
})Exports
viteBundler
Type:
(options?: ViteBundlerOptions) => BundlerDetails:
Create a vite bundler instance.
viteMergeConfig
Type:
(configA: ViteUserConfig, configB: ViteUserConfig) => ViteUserConfigDetails:
Merge two vite config objects, provided by vite's mergeConfig JavaScript API.
Options
viteOptions
Details:
Accepts all options of Vite.
Also see:
vuePluginOptions
Details:
Accepts all options of @vitejs/plugin-vue.
Also see:
configureVite
Type:
(config: ViteUserConfig, isServer: boolean, isBuild: boolean) => ViteUserConfig | voidDetails:
Edit the internal vite config.
This option accepts a function that will receive a vite config object as the 1st argument, an
isServerflag as the 2nd argument and anisBuildflag as the 3rd argument. You can either mutate the config directly, or return an object to replace the vite config object.
