Skip to content

Commit 66d4841

Browse files
committed
fix: resolved conflict
1 parent 770ba56 commit 66d4841

4 files changed

Lines changed: 6 additions & 61 deletions

File tree

guide/dep-pre-bundling.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,6 @@ Vite 将预构建的依赖项缓存到 `node_modules/.vite` 中。它会基于
8383

8484
已预构建的依赖请求使用 HTTP 头 `max-age=31536000, immutable` 进行强缓存,以提高开发期间页面重新加载的性能。一旦被缓存,这些请求将永远不会再次访问开发服务器。如果安装了不同版本的依赖项(这反映在包管理器的 lockfile 中),则会通过附加版本查询自动失效。如果你想通过本地编辑来调试依赖项,您可以:
8585

86-
<<<<<<< HEAD
87-
1. 通过浏览器开发工具的 Network 选项卡暂时禁用缓存;
88-
2. 重启 Vite 开发服务器指定 `--force` 选项,来重新构建依赖项;
86+
1. 通过浏览器开发工具的 Network 选项卡暂时禁用缓存。
87+
2. 重启 Vite 开发服务器指定 `--force` 选项,来重新构建依赖项。
8988
3. 重新载入页面。
90-
=======
91-
1. Temporarily disable cache via the Network tab of your browser devtools.
92-
2. Restart Vite dev server with the `--force` flag to re-bundle the deps.
93-
3. Reload the page.
94-
>>>>>>> c051c833e3340a8ea5a343bc1416600fdcfed087

guide/features.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -175,13 +175,8 @@ HTML 文件位于 Vite 项目的[最前端和中心](/guide/#index-html-and-proj
175175

176176
- `<audio src>`
177177
- `<embed src>`
178-
<<<<<<< HEAD
179178
- `<img src>``<img srcset>`
180-
- `<image src>`
181-
=======
182-
- `<img src>` and `<img srcset>`
183-
- `<image href>` and `<image xlink:href>`
184-
>>>>>>> c051c833e3340a8ea5a343bc1416600fdcfed087
179+
- `<image href>``<image xlink:href>`
185180
- `<input src>`
186181
- `<link href>``<link imagesrcset>`
187182
- `<object data>`

guide/index.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,8 @@ Vite 还提供了强大的扩展性,可通过其 [插件 API](./api-plugin)
4343

4444
## 搭建第一个 Vite 项目 {#scaffolding-your-first-vite-project}
4545

46-
<<<<<<< HEAD
4746
::: tip 兼容性注意
48-
Vite 需要 [Node.js](https://nodejs.org/en/) 版本 20+。然而,有些模板需要依赖更高的 Node 版本才能正常运行,当你的包管理器发出警告时,请注意升级你的 Node 版本。
49-
=======
50-
::: tip Compatibility Note
51-
Vite requires [Node.js](https://nodejs.org/en/) version 20.19+, 22.12+. However, some templates require a higher Node.js version to work, please upgrade if your package manager warns about it.
52-
>>>>>>> c051c833e3340a8ea5a343bc1416600fdcfed087
47+
Vite 需要 [Node.js](https://nodejs.org/en/) 版本 20.19+, 22.12+。然而,有些模板需要依赖更高的 Node 版本才能正常运行,当你的包管理器发出警告时,请注意升级你的 Node 版本。
5348
:::
5449

5550
::: code-group

guide/troubleshooting.md

Lines changed: 2 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -4,42 +4,7 @@
44
55
如果这里的建议并未帮助到你,请将你的问题发送到 [GitHub 讨论区](https://github.com/vitejs/vite/discussions)[Vite Land Discord](https://chat.vite.dev)`#help` 频道。
66

7-
<<<<<<< HEAD
8-
## CJS
9-
10-
### Vite CJS Node API deprecated {#vite-cjs-node-api-deprecated}
11-
12-
Vite 的 CJS Node API 构建已经被废弃,并将在 Vite 6 中移除。查看 [GitHub 讨论区](https://github.com/vitejs/vite/discussions/13928) 了解更多背景信息。你应该更新你的文件或框架来导入 Vite 的 ESM 构建。
13-
14-
在一个基础的 Vite 项目中,请确保:
15-
16-
1. `vite.config.js` 配置文件的内容使用 ESM 语法。
17-
2. 最近的 `package.json` 文件中有 `"type": "module"`,或者使用 `.mjs`/`.mts` 扩展名,例如 `vite.config.mjs` 或者 `vite.config.mts`
18-
19-
对于其他项目,有几种常见的方法:
20-
21-
- **配置 ESM 为默认,如果需要则选择 CJS:** 在项目 `package.json` 中添加 `"type": "module"`。所有 `*.js` 文件现在都被解释为 ESM,并且需要使用 ESM 语法。你可以将一个文件重命名为 `.cjs` 扩展名来继续使用 CJS。
22-
- **保持 CJS 为默认,如果需要则选择 ESM:** 如果项目 `package.json` 没有 `"type": "module"`,所有 `*.js` 文件都被解释为 CJS。你可以将一个文件重命名为 `.mjs` 扩展名来使用 ESM。
23-
- **动态导入 Vite:** 如果你需要继续使用 CJS,你可以使用 `import('vite')` 动态导入 Vite。这要求你的代码必须在一个 `async` 上下文中编写,但是由于 Vite 的 API 大多是异步的,所以应该还是可以管理的。
24-
25-
如果你不确定警告来自哪里,你可以通过 `VITE_CJS_TRACE=true` 标志运行你的脚本来记录堆栈跟踪:
26-
27-
```bash
28-
VITE_CJS_TRACE=true vite dev
29-
```
30-
31-
如果你想暂时忽略警告,你可以通过 `VITE_CJS_IGNORE_WARNING=true` 标志运行你的脚本:
32-
33-
```bash
34-
VITE_CJS_IGNORE_WARNING=true vite dev
35-
```
36-
37-
请注意,postcss 配置文件还不支持 ESM + TypeScript(`"type": "module"` 中的 `.mts``.ts`)。如果你有带 `.ts` 的 postcss 配置,并在 package.json 中添加了 `"type": "module"`,你还需要将 postcss 配置重命名为 `.cts`
38-
39-
## CLI {#cli}
40-
=======
417
## CLI
42-
>>>>>>> c051c833e3340a8ea5a343bc1416600fdcfed087
438

449
### `Error: Cannot find module 'C:\foo\bar&baz\vite\bin\vite.js'` {#error-cannot-find-module-cfoobarbazvitebinvitejs}
4510

@@ -248,23 +213,19 @@ Vite 无法处理、也不支持仅可在非严格模式(sloppy mode)下运
248213
- 通过 `subst` 命令将虚拟驱动器链接到一个文件夹
249214
- 通过 `mklink` 命令将符号链接/联接到另一个驱动器(例如 Yarn 全局缓存)
250215

251-
<<<<<<< HEAD
252216
相关 issue:[#10802](https://github.com/vitejs/vite/issues/10802)
253-
=======
254-
Related issue: [#10802](https://github.com/vitejs/vite/issues/10802)
255217

256218
<script setup lang="ts">
257-
// redirect old links with hash to old version docs
219+
// 使用哈希将旧链接重定向到旧版本文档
258220
if (typeof window !== "undefined") {
259221
const hashForOldVersion = {
260222
'vite-cjs-node-api-deprecated': 6
261223
}
262224

263225
const version = hashForOldVersion[location.hash.slice(1)]
264226
if (version) {
265-
// update the scheme and the port as well so that it works in local preview (it is http and 4173 locally)
227+
// 更新 scheme 和端口,以便它在本地预览中工作(本地为 http 4173
266228
location.href = `https://v${version}.vite.dev` + location.pathname + location.search + location.hash
267229
}
268230
}
269231
</script>
270-
>>>>>>> c051c833e3340a8ea5a343bc1416600fdcfed087

0 commit comments

Comments
 (0)