File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121- ** 类型:** ` boolean | { polyfill?: boolean, resolveDependencies?: ResolveModulePreloadDependenciesFn } `
2222- ** 默认值:** ` { polyfill: true } `
2323
24- 默认情况下,一个 [ 模块预加载 polyfill] ( https://guybedford.com/es-module-preloading-integrity#modulepreload-polyfill ) 会被自动注入。该 polyfill 会自动注入到每个 ` index.html ` 入口的的代理模块中。如果构建通过 ` build.rollupOptions .input ` 被配置为了使用非 HTML 入口的形式,那么必须要在你的自定义入口中手动引入该 polyfill:
24+ 默认情况下,一个 [ 模块预加载 polyfill] ( https://guybedford.com/es-module-preloading-integrity#modulepreload-polyfill ) 会被自动注入。该 polyfill 会自动注入到每个 ` index.html ` 入口的的代理模块中。如果构建通过 ` build.rolldownOptions .input ` 被配置为了使用非 HTML 入口的形式,那么必须要在你的自定义入口中手动引入该 polyfill:
2525
2626``` js
2727import ' vite/modulepreload-polyfill'
@@ -269,7 +269,7 @@ export default defineConfig({
269269- ** 默认值:** ` false `
270270- ** 相关链接:** [ 服务端渲染] ( /guide/ssr )
271271
272- 生成面向 SSR 的构建。此选项的值可以是字符串,用于直接定义 SSR 的入口,也可以为 ` true ` ,但这需要通过设置 ` rollupOptions .input` 来指定 SSR 的入口。
272+ 生成面向 SSR 的构建。此选项的值可以是字符串,用于直接定义 SSR 的入口,也可以为 ` true ` ,但这需要通过设置 ` rolldownOptions .input` 来指定 SSR 的入口。
273273
274274## build.emitAssets
275275
Original file line number Diff line number Diff line change 88
99- ** 类型:** ` string | string[] `
1010
11- 默认情况下,Vite 会抓取你的 ` index.html ` 来检测需要预构建的依赖项(忽略了` node_modules ` 、` build.outDir ` 、` __tests__ ` 和 ` coverage ` )。如果指定了 ` build.rollupOptions .input ` ,Vite 将转而去抓取这些入口点。
11+ 默认情况下,Vite 会抓取你的 ` index.html ` 来检测需要预构建的依赖项(忽略了` node_modules ` 、` build.outDir ` 、` __tests__ ` 和 ` coverage ` )。如果指定了 ` build.rolldownOptions .input ` ,Vite 将转而去抓取这些入口点。
1212
1313如果这两者都不合你意,则可以使用此选项指定自定义条目——该值需要遵循 [ tinyglobby 模式] ( https://superchupu.dev/tinyglobby/comparison ) ,或者是相对于 Vite 项目根目录的匹配模式数组。当显式声明了 ` optimizeDeps.entries ` 时默认只有 ` node_modules ` 和 ` build.outDir ` 文件夹会被忽略。如果还需忽略其他文件夹,你可以在模式列表中使用以 ` ! ` 为前缀的、用来匹配忽略项的模式。对于明确包含字符串 ` node_modules ` 的模式,不会忽略 ` node_modules ` 。
1414
Original file line number Diff line number Diff line change @@ -433,7 +433,7 @@ export default defineConfig({
433433
434434是否忽略服务器 sourcemap 中的源文件,用于填充 [ ` x_google_ignoreList ` source map 扩展] ( https://developer.chrome.com/articles/x-google-ignore-list/ ) 。
435435
436- 对开发服务器来说 ` server.sourcemapIgnoreList ` 等价于 [ ` build.rollupOptions .output.sourcemapIgnoreList ` ] ( https://cn.rollupjs.org/configuration-options/#output-sourcemapignorelist ) 。两个配置选项之间的区别在于,rollup 函数使用相对路径调用 ` sourcePath ` ,而 ` server.sourcemapIgnoreList ` 使用绝对路径调用。在开发过程中,大多数模块的映射和源文件位于同一个文件夹中,因此 ` sourcePath ` 的相对路径就是文件名本身。在这些情况下,使用绝对路径更加方便。
436+ 对开发服务器来说 ` server.sourcemapIgnoreList ` 等价于 [ ` build.rolldownOptions .output.sourcemapIgnoreList ` ] ( https://cn.rollupjs.org/configuration-options/#output-sourcemapignorelist ) 。两个配置选项之间的区别在于,rollup 函数使用相对路径调用 ` sourcePath ` ,而 ` server.sourcemapIgnoreList ` 使用绝对路径调用。在开发过程中,大多数模块的映射和源文件位于同一个文件夹中,因此 ` sourcePath ` 的相对路径就是文件名本身。在这些情况下,使用绝对路径更加方便。
437437
438438默认情况下,它会排除所有包含 ` node_modules ` 的路径。你可以传递 ` false ` 来禁用此行为,或者为了获得完全的控制,可以传递一个函数,该函数接受源路径和 sourcemap 的路径,并返回是否忽略源路径。
439439
@@ -450,5 +450,5 @@ export default defineConfig({
450450```
451451
452452::: tip 注意
453- 需要单独设置 [ ` server.sourcemapIgnoreList ` ] ( #server-sourcemapignorelist ) 和 [ ` build.rollupOptions .output.sourcemapIgnoreList ` ] ( https://cn.rollupjs.org/configuration-options/#output-sourcemapignorelist ) 。` server.sourcemapIgnoreList ` 是一个仅适用于服务端的配置,并不从定义好的 rollup 选项中获得其默认值。
453+ 需要单独设置 [ ` server.sourcemapIgnoreList ` ] ( #server-sourcemapignorelist ) 和 [ ` build.rolldownOptions .output.sourcemapIgnoreList ` ] ( https://cn.rollupjs.org/configuration-options/#output-sourcemapignorelist ) 。` server.sourcemapIgnoreList ` 是一个仅适用于服务端的配置,并不从定义好的 rollup 选项中获得其默认值。
454454:::
Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ resolve: {
145145如果你在你的应用程序中有相同依赖的副本(比如 monorepos),请使用此选项强制 Vite 始终将列出的依赖项解析为同一副本(从项目根目录)。
146146
147147:::warning SSR + ESM
148- 对于服务端渲染构建,配置项 ` build.rollupOptions .output ` 为 ESM 构建输出时去重过程将不工作。一个替代方案是先使用 CJS 构建输出,直到 ESM 在插件中有了更好的模块加载支持。
148+ 对于服务端渲染构建,配置项 ` build.rolldownOptions .output ` 为 ESM 构建输出时去重过程将不工作。一个替代方案是先使用 CJS 构建输出,直到 ESM 在插件中有了更好的模块加载支持。
149149:::
150150
151151## resolve.conditions <NonInheritBadge /> {#resolve-conditions}
Original file line number Diff line number Diff line change @@ -211,7 +211,7 @@ await build({
211211 root: path.resolve(import.meta.dirname, './project'),
212212 base: '/foo/',
213213 build: {
214- rollupOptions : {
214+ rolldownOptions : {
215215 // ...
216216 },
217217 },
Original file line number Diff line number Diff line change 2121 build: {
2222 // 在 outDir 中生成 .vite/manifest.json
2323 manifest: true ,
24- rollupOptions : {
24+ rolldownOptions : {
2525 // 覆盖默认的 .html 入口
2626 input: ' /path/to/main.js'
2727 }
179179 ```
180180
181181 清单中的每个条目代表以下之一:
182- - ** Entry chunks** :由 [ ` build.rollupOptions .input ` ] ( https://rollupjs.org/configuration-options/#input ) 中指定的文件生成。这些块的 isEntry 属性设置为 true,其键值是项目根目录的相对 src 路径。
182+ - ** Entry chunks** :由 [ ` build.rolldownOptions .input ` ] ( https://rollupjs.org/configuration-options/#input ) 中指定的文件生成。这些块的 isEntry 属性设置为 true,其键值是项目根目录的相对 src 路径。
183183 - ** Dynamic entry chunks** :由动态导入生成。这些块的 isDynamicEntry 属性设置为 true,其键值是项目根目录的相对 src 路径。
184184 - ** Non-entry chunks** :其键值是生成文件的基本名称加上前缀 ` _ ` 。
185185 - ** Asset chunks** :由导入的资源(例如图片、字体)生成。其键值是项目根目录的相对 src 路径。
Original file line number Diff line number Diff line change @@ -268,7 +268,7 @@ pnpm link # 在这一步中可使用你喜欢的包管理器
268268想了解更多关于 Vite 如何以及何时发布的信息,请查看 [ 发布] ( ../releases.md ) 文档。
269269
270270::: tip 处理依赖中的 Vite 版本
271- 若需替换依赖链中传递使用的 Vite 版本(Transitive Dependencies),应使用 [ npm overrides] ( https://docs.npmjs.com/cli/v11/configuring-npm/package-json#overrides ) 或 [ pnpm overrides] ( https://pnpm.io/9.x/package_json#pnpmoverrides ) 。
271+ 若需替换依赖链中传递使用的 Vite 版本(Transitive Dependencies),应使用 [ npm overrides] ( https://docs.npmjs.com/cli/v11/configuring-npm/package-json#overrides ) 或 [ pnpm overrides] ( https://pnpm.io/settings#overrides ) 。
272272:::
273273
274274## 社区 {#community}
Original file line number Diff line number Diff line change 88 "private" : true ,
99 "license" : " CC BY-NC-SA 4.0" ,
1010 "devDependencies" : {
11- "@iconify/vue" : " ^5.0.0 " ,
11+ "@iconify/vue" : " ^5.0.1 " ,
1212 "@shikijs/vitepress-twoslash" : " ^4.0.2" ,
1313 "@type-challenges/utils" : " ^0.1.1" ,
1414 "@types/express" : " ^5.0.6" ,
2020 "gsap" : " ^3.14.2" ,
2121 "lodash" : " ^4.17.23" ,
2222 "markdown-it-image-size" : " ^15.0.1" ,
23- "vite" : " ^7.3.1 " ,
23+ "vite" : " ^8.0.13 " ,
2424 "vitepress" : " 2.0.0-alpha.17" ,
2525 "vitepress-plugin-graphviz" : " ^0.1.0" ,
2626 "vitepress-plugin-group-icons" : " ^1.7.5" ,
27- "vue" : " ^3.5.33 " ,
28- "vue-tsc" : " ^3.2.7 " ,
27+ "vue" : " ^3.5.34 " ,
28+ "vue-tsc" : " ^3.2.8 " ,
2929 "yorkie" : " ^2.0.0"
3030 },
3131 "packageManager" : " pnpm@9.6.0" ,
You can’t perform that action at this time.
0 commit comments