Skip to content
Merged

d2m #1489

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,10 @@ create-vite 是一个快速生成主流框架基础模板的工具。查看 Awes

对于一个 `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` 作为默认分支,可以使用以下命令创建本地副本:
Copy link

Copilot AI Dec 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

删除了 #main 分支指定符,但文档说明仍然提到"假设项目在 GitHub 上并使用 main 作为默认分支"。如果移除了分支指定符,这个说明就不再准确了。tiged 默认会使用仓库的默认分支,无论是什么分支。建议更新说明以反映实际行为,例如:"假设项目在 GitHub 上,可以使用以下命令创建本地副本(tiged 会使用仓库的默认分支)"。

Suggested change
你也可以用如 [tiged](https://github.com/tiged/tiged) 之类的工具,使用社区模版来搭建项目。假设项目在 GitHub 上并使用 `main` 作为默认分支,可以使用以下命令创建本地副本:
你也可以用如 [tiged](https://github.com/tiged/tiged) 之类的工具,使用社区模版来搭建项目。假设项目在 GitHub ,可以使用以下命令创建本地副本(tiged 会使用仓库的默认分支)

Copilot uses AI. Check for mistakes.

```bash
npx degit user/project#main my-project
npx tiged user/project my-project
cd my-project

npm install
Expand Down
7 changes: 3 additions & 4 deletions guide/performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,12 @@ export default defineConfig({

精简工作的例子:

- 使用 CSS 而不是 Sass/Less/Stylus(可以由 PostCSS 处理嵌套)
- 使用 CSS 而不是 Sass/Less/Stylus(可以由 PostCSS / Lightning CSS 处理嵌套)
- 不要将 SVG 转换为 UI 框架组件(例如 React、Vue 等)。请将其作为字符串或 URL 导入。
- 当使用 `@vitejs/plugin-react` 时,避免配置 Babel 选项,这样它就会在构建期间跳过转换(只使用 esbuild)。
- 当使用 `@vitejs/plugin-react` 时,避免配置 Babel 选项,这样它就会在构建期间跳过转换(只使用 Oxc)。
Copy link

Copilot AI Dec 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个说法不准确。根据 guide/rolldown.md:158 的文档,@vitejs/plugin-react v5.0.0+ 版本只有在没有配置任何 Babel 插件时才会使用 Oxc 完成整个转换过程。如果避免配置 Babel 选项,它会在开发期间使用 Oxc,但在构建期间可能仍然会使用 esbuild(取决于版本和配置)。建议修改为更准确的表述,例如:"当使用 @vitejs/plugin-react 时,避免配置 Babel 选项,这样它就会使用 Oxc 进行转换"。

Suggested change
- 当使用 `@vitejs/plugin-react` 时,避免配置 Babel 选项,这样它就会在构建期间跳过转换(只使用 Oxc)。
- 当使用 `@vitejs/plugin-react` 时,避免配置 Babel 选项,这样它会使用 Oxc 进行转换(开发期间使用 Oxc,构建期间可能仍然会用到 esbuild,具体取决于版本和配置)。

Copilot uses AI. Check for mistakes.

使用更原生化工具链的例子:

使用更原生化的工具链往往会带来更大的安装大小,因此在启动新的 Vite 项目时不是默认的。但对于较大的应用程序来说,这可能是值得的。
尽管 Vite 核心基于原生工具,但某些功能仍默认使用非原生工具,以提供更好的兼容性和功能集。但对于较大的应用程序来说,这可能是值得的。

- 尝试实验性的 [LightningCSS](https://github.com/vitejs/vite/discussions/13835)
Copy link

Copilot AI Dec 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

移除了关于 @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,对于某些项目来说可能仍然是更好的选择。建议保留此行或更新为更准确的建议,例如说明两种插件的使用场景。

Copilot uses AI. Check for mistakes.
- 使用 [`@vitejs/plugin-react-swc`](https://github.com/vitejs/vite-plugin-react-swc) 代替 `@vitejs/plugin-react`。