Vite

@vuepress/bundler-vite

Vite 打包工具是由 @vuepress/bundler-vite在新窗口打开 包提供的。它是 vuepress-vite在新窗口打开 包的依赖之一,当然你也可以单独安装它:

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

配置项

Vite 打包工具配置的参考文档,可以通过 bundlerConfig 来设置这些配置。

module.exports = {
  // 在使用 vuepress-vite 包的时候,你可以忽略这个字段,因为 Vite 是默认打包工具
  bundler: '@vuepress/bundler-vite',
  // Vite 打包工具的配置项
  bundlerConfig: {
    // 查看下方
  },
}
1
2
3
4
5
6
7
8
import type { ViteBundlerOptions } from '@vuepress/bundler-vite'
import { defineUserConfig } from '@vuepress/cli'
import type { DefaultThemeOptions } from '@vuepress/theme-default'

export default defineUserConfig<DefaultThemeOptions, ViteBundlerOptions>({
  // 在使用 vuepress-vite 包的时候,你可以忽略这个字段,因为 Vite 是默认打包工具
  bundler: '@vuepress/bundler-vite',
  // Vite 打包工具的配置项
  bundlerConfig: {
    // 查看下方
  },
})
1
2
3
4
5
6
7
8
9
10
11
12

viteOptions

vuePluginOptions