Skip to content

Commit c5add61

Browse files
Merge pull request webpack#5 from viko16/cn
translate 'stats' and 'watch'
2 parents f444ab0 + 4c5e39f commit c5add61

File tree

2 files changed

+18
-16
lines changed

2 files changed

+18
-16
lines changed

content/configuration/stats.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,24 @@
22
title: 统计
33
contributors:
44
- SpaceK33z
5+
- viko16
56
---
67

7-
The `stats` option lets you precisely control what bundle information gets displayed. This can be a nice middle ground if you don't want to use `quiet` or `noInfo` because you want some bundle information, but not all of it.
8+
`stats` 选项能让你准确地控制显示哪些包的信息。如果你希望得到部分包的信息(而不是一股脑全部输出),而不想使用 `quiet` 或者 `noInfo` 模式的时候,这个选项会是一个很好的折衷办法。
89

9-
T> For webpack-dev-server, this property needs to be in the `devServer` object.
10+
T> 对于 webpack-dev-server ,这个属性要放在 `devServer` 对象里。
1011

1112
## `stats`
1213

1314
`object` `string`
1415

15-
There are some presets: `none`, `errors-only`, `minimal` and `verbose`. Use them like this:
16+
预设选项:`none`, `errors-only`, `minimal` `verbose`。使用方法:
1617

1718
```js
1819
stats: "errors-only"
1920
```
2021

21-
For more granular control, it is possible to specify exactly what information you want:
22+
对于更精细的控制,这样可以准确地指定你想要的信息:
2223

2324
```js
2425
stats: {
@@ -27,7 +28,7 @@ stats: {
2728
}
2829
```
2930

30-
The available properties in this object are:
31+
此对象的可用属性包括:
3132

3233
* `assets`
3334
* `children`

content/configuration/watch.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,28 @@ contributors:
44
- sokra
55
- skipjack
66
- SpaceK33z
7+
- viko16
78
---
89

9-
Webpack can watch files and recompile whenever they change. This page explains how to enable this and a couple of tweaks you can make if watching does not properly for you.
10+
Webpack 可以监听文件变化,当它们修改后会重新编译。这个页面介绍了如何启用这个功能,以及当 Watch 不正常的时候你可以做的一些调整。
1011

1112
### `watch`
1213

1314
`boolean`
1415

15-
Turn on watch mode. This means that after the initial build, webpack will continue to watch for changes in any of the resolved files. Watch mode is turned off by default:
16+
启用 Watch 模式。这意味着在初始构建之后,Webpack 将继续监听任何已解析文件的更改。Watch 模式默认关闭。
1617

1718
```js
1819
watch: false
1920
```
2021

21-
T> In webpack-dev-server and webpack-dev-middleware watch mode is enabled by default.
22+
T> webpack-dev-server webpack-dev-middleware 里 Watch 模式默认开启。
2223

2324
### `watchOptions`
2425

2526
`object`
2627

27-
A set of options used to customize watch mode:
28+
一组用来定制 Watch 模式的选项:
2829

2930
```js
3031
watchOptions: {
@@ -38,22 +39,22 @@ watchOptions: {
3839

3940
`number`
4041

41-
Add a delay before rebuilding once the first file changed. This allows webpack to aggregate any other changes made during this time period into one rebuild. Pass a value in milliseconds:
42+
当第一个文件更改,会在重新构建前增加延迟。这个选项允许 Webpack 将这段时间内进行的任何其他更改都聚合到一次重新构建里。以毫秒为单位:
4243

4344
```js
44-
aggregateTimeout: 300 // The default
45+
aggregateTimeout: 300 // 默认值
4546
```
4647

4748

4849
### `watchOptions.ignored`
4950

50-
For some systems, watching many file systems can result in a lot of CPU or memory usage. It is possible to exclude a huge folder like `node_modules`:
51+
对于某些系统,监听大量文件系统会导致大量的 CPU 或内存占用。这个选项可以排除一些巨大的文件夹,例如 `node_modules`
5152

5253
```js
5354
ignored: /node_modules/
5455
```
5556

56-
It is also possible to use [anymatch](https://github.com/es128/anymatch) patterns:
57+
也可以使用 [anymatch](https://github.com/es128/anymatch) 模式:
5758

5859
```js
5960
ignored: "files/**/*.js"
@@ -64,11 +65,11 @@ ignored: "files/**/*.js"
6465

6566
`boolean` `number`
6667

67-
Turn on [polling](http://whatis.techtarget.com/definition/polling) by passing `true`, or specifying a poll interval in milliseconds:
68+
通过传递 `true` 开启 [polling](http://whatis.techtarget.com/definition/polling),或者指定毫秒为单位进行轮询。
6869

6970
```js
70-
poll: 1000 // Check for changes every second
71+
poll: 1000 // 每秒检查一次变动
7172
```
7273

73-
T> If watching does not work for you, try out this option. Watching does not work with NFS and machines in VirtualBox.
74+
T> 如果监听没生效,试试这个选项吧。Watch 在 NFS VirtualBox 机器上不适用。
7475

0 commit comments

Comments
 (0)