d2m#1532
Conversation
docs(en): merge docs-cn/sync-docs into docs-cn/dev @ 93e15e7
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
Updates the documentation to reflect Vite’s Rolldown-based toolchain, replacing/escalating former Rollup/esbuild references and filling in previously missing Rolldown links.
Changes:
- Add/replace Rolldown reference links across migration, build, dep-optimization, and plugin API docs.
- Expand
resolve.aliasdocumentation with clearer semantics and examples. - Clarify dynamic-import bundling constraints and update related config docs.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| guide/migration.md | Replaces TODOs with concrete Rolldown reference links and updates migration guidance. |
| guide/features.md | Adds explicit rules for when variable dynamic imports can be bundled. |
| guide/dep-pre-bundling.md | Updates dep pre-bundling customization guidance to Rolldown options. |
| guide/build.md | Removes outdated TODO notes about Rolldown documentation links. |
| guide/api-plugin.md | Reorients plugin API docs from Rollup to Rolldown, updating conventions and hook links. |
| config/shared-options.md | Rewrites and expands resolve.alias explanation, adding format-specific sections and examples. |
| config/dep-optimization-options.md | Adds Rolldown reference links in optimizeDeps.rolldownOptions type docs and removes TODOs. |
| config/build-options.md | Updates build.dynamicImportVarsOptions documentation to reflect the new option shape and references. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ### Object Format (`Record<string, string>`) | ||
|
|
There was a problem hiding this comment.
这一小节是中文文档,但新增了英文小标题(Object Format / Array Format)。建议将标题翻译为中文或使用中英对照,以保持同页风格一致。
| resolve: { | ||
| alias: { | ||
| utils: '../../../utils', | ||
| 'batman-1.0.0': './joker-1.5.0' | ||
| } |
There was a problem hiding this comment.
上面刚说明“当使用文件系统路径的别名时,请始终使用绝对路径”,但这里的示例使用了相对路径(如 ../../../utils、./joker-1.5.0),与说明相矛盾且会误导读者。建议将示例改为绝对路径(例如使用 path.resolve(...)),或调整文字说明以匹配示例。
| - **类型:** `{ include?: string | RegExp | (string | RegExp)[], exclude?: string | RegExp | (string | RegExp)[] }` | ||
| - **相关内容:** [Dynamic Import](/guide/features#dynamic-import) | ||
|
|
||
| 传递给 [@rollup/plugin-dynamic-import-vars](https://github.com/rollup/plugins/tree/master/packages/dynamic-import-vars) 的选项。 | ||
|
|
||
| <!-- TODO: we need to have a more detailed explanation here as we no longer use @rollup/plugin-dynamic-import-vars. we should say it's compatible with it though --> | ||
| 是否转换带有变量的动态导入。 |
There was a problem hiding this comment.
build.dynamicImportVarsOptions 的“相关内容”链接文本变成了英文(Dynamic Import),而本文件其它“相关内容”均为中文;另外“是否转换...”表述像是布尔开关,但类型是对象(include/exclude)。建议统一为中文链接文本,并把说明改成“用于配置/控制带变量动态导入的转换(include/exclude)”之类的表述,避免误解。
| - [`options`](https://rolldown.rs/reference/interface.plugin#options) | ||
| - [`buildStart`](https://rolldown.rs/reference/Interface.Plugin#buildstart) |
There was a problem hiding this comment.
这里对同一个 Rolldown 类型的引用 URL 使用了两种大小写路径(reference/interface.plugin vs reference/Interface.Plugin)。URL 路径通常大小写敏感,这会导致其中一部分链接失效。建议统一为 Rolldown 文档实际使用的那一种路径,并在全文保持一致。
| 你还可以使用 [`optimizeDeps.rolldownOptions` 选项](/config/dep-optimization-options.md#optimizedeps-rolldownoptions) 进一步自定义 Rolldown。例如,添加 Rolldown 插件来处理依赖项中的特殊文件,或者更改 [构建 `target`](https://rolldown.rs/reference/InputOptions.transform#target)。 | ||
|
|
||
| <!-- TODO: update the link above to Rolldown's documentation --> |
There was a problem hiding this comment.
这里的 TODO 说明“update the link above to Rolldown's documentation”,但上一行的 target 已经指向 Rolldown 文档了。建议删除这个 TODO,或更新为当前仍待完成的事项,避免留下过期注释。
| <!-- TODO: add link to rolldownOptions.* --> | ||
| - [`esbuildOptions.minify`](https://esbuild.github.io/api/#minify) -> [`rolldownOptions.output.minify`](https://rolldown.rs/reference/OutputOptions.minify) | ||
| - [`esbuildOptions.treeShaking`](https://esbuild.github.io/api/#tree-shaking) -> [`rolldownOptions.treeshake`](https://rolldown.rs/reference/InputOptions.treeshake) | ||
| - [`esbuildOptions.define`](https://esbuild.github.io/api/#define) -> [`rolldownOptions.transform.define`](https://rolldown.rs/reference/InputOptions.transform#define) |
There was a problem hiding this comment.
rolldownOptions.transform.define 的链接 URL 末尾多了一个 )(...#define)),会导致链接失效。请去掉多余的括号,确保指向正确的锚点。
| `output.manualChunks` 选项已被弃用。Rolldown 提供了更灵活的 `advancedChunks` 选项。有关 `advancedChunks` 的更多详情,请参阅 Rolldown 的文档:[高级分块 - Rolldown](https://rolldown.rs/in-depth/advanced-chunks)。 | ||
|
|
||
| <!-- TODO: add link to rolldownOptions.output.advancedChunks --> | ||
| `output.manualChunks` 选项已弃用。Rolldown 提供了更灵活的 `advancedChunks` 选项(https://rolldown.rs/reference/OutputOptions.advancedChunks)。有关 `advancedChunks` 的更多详细信息,请参阅 Rolldown 的文档:[Advanced Chunks - Rolldown](https://rolldown.rs/in-depth/advanced-chunks)。 |
There was a problem hiding this comment.
这里的 advancedChunks 选项使用了裸露 URL(括号里直接放链接),与本页其它引用的写法不一致,也不利于后续维护/校验。建议改为标准的 Markdown 链接(并使用一致的链接文本)。
| `output.manualChunks` 选项已弃用。Rolldown 提供了更灵活的 `advancedChunks` 选项(https://rolldown.rs/reference/OutputOptions.advancedChunks)。有关 `advancedChunks` 的更多详细信息,请参阅 Rolldown 的文档:[Advanced Chunks - Rolldown](https://rolldown.rs/in-depth/advanced-chunks)。 | |
| `output.manualChunks` 选项已弃用。Rolldown 提供了更灵活的 `advancedChunks` 选项([`OutputOptions.advancedChunks`](https://rolldown.rs/reference/OutputOptions.advancedChunks))。有关 `advancedChunks` 的更多详细信息,请参阅 Rolldown 的文档:[Advanced Chunks - Rolldown](https://rolldown.rs/in-depth/advanced-chunks)。 |
| resolve: { | ||
| alias: [ | ||
| { find: 'utils', replacement: '../../../utils' }, | ||
| { find: 'batman-1.0.0', replacement: './joker-1.5.0' }, | ||
| ] |
There was a problem hiding this comment.
数组格式示例同样使用了相对路径(../../../utils、./joker-1.5.0),与本节“请始终使用绝对路径”的说明冲突。建议改为绝对路径写法(或相应修改前文规则)。
| # 插件 API {#plugin-api} | ||
|
|
||
| Vite 插件扩展了设计出色的 Rollup 接口,带有一些 Vite 独有的配置项。因此,你只需要编写一个 Vite 插件,就可以同时为开发环境和生产环境工作。 | ||
| Vite 插件扩展了 Rolldown 的插件接口,添加了一些 Vite 特有的选项。因此,您只需编写一次 Vite 插件,即可使其同时适用于开发环境和构建环境。 |
There was a problem hiding this comment.
这一段落同时使用了“您”和“你”(例如本段用“您”,下一段又是“你”),同一篇文档里称谓不一致会影响阅读体验。建议在全文统一使用同一种人称(通常为“你”)。
| Vite 插件扩展了 Rolldown 的插件接口,添加了一些 Vite 特有的选项。因此,您只需编写一次 Vite 插件,即可使其同时适用于开发环境和构建环境。 | |
| Vite 插件扩展了 Rolldown 的插件接口,添加了一些 Vite 特有的选项。因此,你只需编写一次 Vite 插件,即可使其同时适用于开发环境和构建环境。 |
No description provided.