Skip to content

Commit 8d5d01a

Browse files
committed
docs(cn): fix all conflicts:
1 parent 6e6be65 commit 8d5d01a

File tree

2 files changed

+10
-26
lines changed

2 files changed

+10
-26
lines changed

config/index.md

+3-11
Original file line numberDiff line numberDiff line change
@@ -23,26 +23,18 @@ export default {
2323
vite --config my-config.js
2424
```
2525

26-
<<<<<<< HEAD
27-
注意,Vite 会替换 `__filename``__dirname` 以及 `import.meta.url`。如果使用这些名称作为变量名可能会导致代码报错:
28-
=======
29-
::: tip NOTE
30-
Vite will replace `__filename`, `__dirname`, and `import.meta.url` in **CommonJS** and **TypeScript** config files. Using these as variable names will result in an error:
31-
>>>>>>> 6b06d03e15eb053c88fc505b291dd7a5b3d6798d
26+
::: tip 注意
27+
注意,Vite 会在 **CommonJS****TypeScript** 配置文件中替换 `__filename``__dirname` 以及 `import.meta.url`。如果使用这些名称作为变量名可能会导致代码报错:
3228

3329
```js
3430
const __filename = "value"
3531
// will be transformed to
3632
const "path/vite.config.js" = "value"
3733
```
3834

39-
<<<<<<< HEAD
40-
### 配置智能提示 {#config-intellisense}
41-
=======
4235
:::
4336

44-
### Config Intellisense
45-
>>>>>>> 6b06d03e15eb053c88fc505b291dd7a5b3d6798d
37+
### 配置智能提示 {#config-intellisense}
4638

4739
因为 Vite 本身附带 Typescript 类型,所以你可以通过 IDE 和 jsdoc 的配合来实现智能提示:
4840

guide/features.md

+7-15
Original file line numberDiff line numberDiff line change
@@ -352,29 +352,25 @@ init({
352352

353353
## Web Worker {#web-workers}
354354

355-
<<<<<<< HEAD
356-
一个 web worker 脚本可以直接通过添加一个 `?worker``?sharedworker` 查询参数来导入。默认导出一个自定义的 worker 构造器:
357-
=======
358-
### Import with Constructors
355+
### 通过构造器导入 {#import-with-constructors}
359356

360-
A web worker script can be imported using [`new Worker()`](https://developer.mozilla.org/en-US/docs/Web/API/Worker/Worker) and [`new SharedWorker()`](https://developer.mozilla.org/en-US/docs/Web/API/SharedWorker/SharedWorker). Compared to the worker suffixes, this syntax leans closer to the standards and is the **recommended** way to create workers.
357+
一个 Web Worker 可以使用 [`new Worker()`](https://developer.mozilla.org/en-US/docs/Web/API/Worker/Worker) [`new SharedWorker()`](https://developer.mozilla.org/en-US/docs/Web/API/SharedWorker/SharedWorker) 导入。与 worker 后缀相比,这种语法更接近于标准,是创建 worker **推荐** 方式。
361358

362359
```ts
363360
const worker = new Worker(new URL('./worker.js', import.meta.url))
364361
```
365362

366-
The worker constructor also accepts options, which can be used to create "module" workers:
363+
worker 构造函数会接受可以用来创建 “模块” worker 的选项:
367364

368365
```ts
369366
const worker = new Worker(new URL('./worker.js', import.meta.url), {
370367
type: 'module'
371368
})
372369
```
373370

374-
### Import with Query Suffixes
371+
### 带有查询后缀的导入 {#import-with-query-suffixes}
375372

376-
A web worker script can be directly imported by appending `?worker` or `?sharedworker` to the import request. The default export will be a custom worker constructor:
377-
>>>>>>> 6b06d03e15eb053c88fc505b291dd7a5b3d6798d
373+
你可以在导入请求上添加 `?worker``?sharedworker` 查询参数来直接导入一个 web worker 脚本。默认导出会是一个自定义 worker 的构造函数:
378374

379375
```js
380376
import MyWorker from './worker?worker'
@@ -390,13 +386,9 @@ Worker 脚本也可以使用 `import` 语句来替代 `importScripts()` ——
390386
import MyWorker from './worker?worker&inline'
391387
```
392388

393-
<<<<<<< HEAD
394-
## 构建优化 {#build-optimizations}
395-
=======
396-
See [Worker Options](/config/#worker-options) for details on configuring the bundling of all workers.
389+
查看 [Worker 选项](/config/#worker-options) 了解更多关于如何配置打包全部 worker 的相关细节。workers.
397390

398-
## Build Optimizations
399-
>>>>>>> 6b06d03e15eb053c88fc505b291dd7a5b3d6798d
391+
## 构建优化 {#build-optimizations}
400392

401393
> 下面所罗列的功能会自动应用为构建过程的一部分,除非你想禁用它们,否则没有必要显式配置。
402394

0 commit comments

Comments
 (0)