d2m#1489
Conversation
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: sapphi-red <49056869+sapphi-red@users.noreply.github.com>
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
docs: update content
docs(en): merge docs-cn/sync-docs into docs-cn/dev @ a6a5c9d
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
This PR updates Vite documentation to reflect modern tooling recommendations, specifically:
- Migrating from the unmaintained
degittool totigedfor scaffolding projects from community templates - Updating performance optimization suggestions to reference newer Vite tooling (Lightning CSS, Oxc)
- Revising explanations about native tooling to better reflect Vite's current architecture
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| guide/performance.md | Updates performance optimization examples to mention Lightning CSS and Oxc instead of older alternatives; revises the introduction to native tooling section; removes recommendation for @vitejs/plugin-react-swc |
| guide/index.md | Replaces deprecated degit tool with tiged and updates the corresponding command example |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - 使用 CSS 而不是 Sass/Less/Stylus(可以由 PostCSS / Lightning CSS 处理嵌套) | ||
| - 不要将 SVG 转换为 UI 框架组件(例如 React、Vue 等)。请将其作为字符串或 URL 导入。 | ||
| - 当使用 `@vitejs/plugin-react` 时,避免配置 Babel 选项,这样它就会在构建期间跳过转换(只使用 esbuild)。 | ||
| - 当使用 `@vitejs/plugin-react` 时,避免配置 Babel 选项,这样它就会在构建期间跳过转换(只使用 Oxc)。 |
There was a problem hiding this comment.
这个说法不准确。根据 guide/rolldown.md:158 的文档,@vitejs/plugin-react v5.0.0+ 版本只有在没有配置任何 Babel 插件时才会使用 Oxc 完成整个转换过程。如果避免配置 Babel 选项,它会在开发期间使用 Oxc,但在构建期间可能仍然会使用 esbuild(取决于版本和配置)。建议修改为更准确的表述,例如:"当使用 @vitejs/plugin-react 时,避免配置 Babel 选项,这样它就会使用 Oxc 进行转换"。
| - 当使用 `@vitejs/plugin-react` 时,避免配置 Babel 选项,这样它就会在构建期间跳过转换(只使用 Oxc)。 | |
| - 当使用 `@vitejs/plugin-react` 时,避免配置 Babel 选项,这样它会使用 Oxc 进行转换(开发期间使用 Oxc,构建期间可能仍然会用到 esbuild,具体取决于版本和配置)。 |
| 对于一个 `https://github.com/user/project` 中的模板,可以尝试使用 `https://github.stackblitz.com/user/project`(即在项目 URL 的 `github` 后添加 `.stackblitz`)。 | ||
|
|
||
| 你也可以用如 [degit](https://github.com/Rich-Harris/degit) 之类的工具,使用社区模版来搭建项目。假设项目在 GitHub 上并使用 `main` 作为默认分支,可以使用以下命令创建本地副本: | ||
| 你也可以用如 [tiged](https://github.com/tiged/tiged) 之类的工具,使用社区模版来搭建项目。假设项目在 GitHub 上并使用 `main` 作为默认分支,可以使用以下命令创建本地副本: |
There was a problem hiding this comment.
删除了 #main 分支指定符,但文档说明仍然提到"假设项目在 GitHub 上并使用 main 作为默认分支"。如果移除了分支指定符,这个说明就不再准确了。tiged 默认会使用仓库的默认分支,无论是什么分支。建议更新说明以反映实际行为,例如:"假设项目在 GitHub 上,可以使用以下命令创建本地副本(tiged 会使用仓库的默认分支)"。
| 你也可以用如 [tiged](https://github.com/tiged/tiged) 之类的工具,使用社区模版来搭建项目。假设项目在 GitHub 上并使用 `main` 作为默认分支,可以使用以下命令创建本地副本: | |
| 你也可以用如 [tiged](https://github.com/tiged/tiged) 之类的工具,使用社区模版来搭建项目。假设项目在 GitHub 上,可以使用以下命令创建本地副本(tiged 会使用仓库的默认分支): |
| 使用更原生化的工具链往往会带来更大的安装大小,因此在启动新的 Vite 项目时不是默认的。但对于较大的应用程序来说,这可能是值得的。 | ||
| 尽管 Vite 核心基于原生工具,但某些功能仍默认使用非原生工具,以提供更好的兼容性和功能集。但对于较大的应用程序来说,这可能是值得的。 | ||
|
|
||
| - 尝试实验性的 [LightningCSS](https://github.com/vitejs/vite/discussions/13835) |
There was a problem hiding this comment.
移除了关于 @vitejs/plugin-react-swc 的建议,但该插件仍然是一个有效的性能优化选项。根据 guide/rolldown.md:160 和 plugins/index.md:23-25 的文档,@vitejs/plugin-react-swc 仍被推荐用于需要自定义插件的大型项目。虽然 @vitejs/plugin-react 现在也使用 Oxc,但 @vitejs/plugin-react-swc 在开发时使用 SWC 而不是 Babel,对于某些项目来说可能仍然是更好的选择。建议保留此行或更新为更准确的建议,例如说明两种插件的使用场景。
No description provided.