Skip to content

Commit d660043

Browse files
committed
docs(cn): fix conflicts
1 parent bf58f4f commit d660043

File tree

7 files changed

+35
-1245
lines changed

7 files changed

+35
-1245
lines changed

src/content/api/logging.mdx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,14 @@ module.exports = function (source) {
6161
};
6262
```
6363

64-
<<<<<<< HEAD
65-
## Logger methods $#logger-methods$
66-
=======
67-
As you can see from the above `my-webpack-plugin.js` example, there're two types of logging methods,
64+
从上面的 `my-webpack-plugin.js` 例子中你可以看到,有两种打印日志的方法,
6865

6966
1. `compilation.getLogger`
7067
2. `compiler.getInfrastructureLogger`
7168

72-
It's advised to use `compilation.getLogger` when plugin/logging is related to the compilation, and they will be stored within the stats. For logging that happens outside the compilation cycle, use `compiler.getInfrastructureLogger` instead.
69+
当 plugin/logging 与编译相关时,建议使用 `compilation.getLogger`,它们将存储在 stats 中。对于在编译周期之外发生的日志记录,请改用 `compiler.getInfrastructureLogger`
7370

74-
## Logger methods
75-
>>>>>>> 1bc7704750b8b2b27a168a9afc1bf9f070745f0e
71+
## Logger methods $#logger-methods$
7672

7773
- `logger.error(...)`:用于输出错误信息
7874
- `logger.warn(...)`:用于输出警告信息

src/content/api/node.mdx

Lines changed: 4 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,9 @@ import webpack from 'webpack';
5050
```js
5151
const webpack = require('webpack');
5252

53-
<<<<<<< HEAD
54-
webpack({
55-
// [配置对象](/configuration/)
56-
}, (err, stats) => { // [Stats Object](#stats-object)
57-
if (err || stats.hasErrors()) {
58-
// [在这里处理错误](#error-handling)
59-
=======
6053
webpack({}, (err, stats) => {
6154
if (err || stats.hasErrors()) {
6255
// ...
63-
>>>>>>> 1bc7704750b8b2b27a168a9afc1bf9f070745f0e
6456
}
6557
// 处理完成
6658
});
@@ -110,11 +102,7 @@ W> 这个 API 一次仅支持一个编译。当使用 `run` 或者
110102
const webpack = require('webpack');
111103

112104
const compiler = webpack({
113-
<<<<<<< HEAD
114-
// [配置对象](/configuration/)
115-
=======
116105
// ...
117-
>>>>>>> 1bc7704750b8b2b27a168a9afc1bf9f070745f0e
118106
});
119107

120108
compiler.run((err, stats) => {
@@ -142,34 +130,20 @@ watch(watchOptions, callback);
142130
const webpack = require('webpack');
143131

144132
const compiler = webpack({
145-
<<<<<<< HEAD
146-
// [配置对象](/configuration/)
147-
});
148-
149-
const watching = compiler.watch({
150-
// [watchOptions](/configuration/watch/#watchoptions) 示例
151-
aggregateTimeout: 300,
152-
poll: undefined
153-
}, (err, stats) => { // [Stats Object](#stats-object)
154-
// 这里打印 watch/build 结果...
155-
console.log(stats);
156-
});
157-
=======
158133
// ...
159134
});
160135

161136
const watching = compiler.watch(
162137
{
163-
// Example
138+
// 示例
164139
aggregateTimeout: 300,
165140
poll: undefined,
166141
},
167142
(err, stats) => {
168-
// Print watch/build result here...
143+
// 这里打印 watch/build 结果...
169144
console.log(stats);
170145
}
171146
);
172-
>>>>>>> 1bc7704750b8b2b27a168a9afc1bf9f070745f0e
173147
```
174148

175149
`Watching` 配置选项的细节可以在
@@ -237,13 +211,8 @@ T> 当使用 [`MultiCompiler`](#multicompiler) 时,
237211
以 JSON 对象形式返回编译信息。
238212
`options` 可以是一个字符串(预设值)或是颗粒化控制的对象:
239213

240-
<<<<<<< HEAD
241-
``` js-with-links
242-
stats.toJson('minimal'); // [更多选项如: 'verbose' 等](/configuration/stats).
243-
=======
244214
```js
245215
stats.toJson('minimal');
246-
>>>>>>> 1bc7704750b8b2b27a168a9afc1bf9f070745f0e
247216
```
248217

249218
```js
@@ -278,21 +247,6 @@ stats.toString({
278247
```js
279248
const webpack = require('webpack');
280249

281-
<<<<<<< HEAD
282-
webpack({
283-
// [配置对象](/configuration/)
284-
}, (err, stats) => {
285-
if (err) {
286-
console.error(err);
287-
return;
288-
}
289-
290-
console.log(stats.toString({
291-
chunks: false, // 使构建过程更静默无输出
292-
colors: true // 在控制台展示颜色
293-
}));
294-
});
295-
=======
296250
webpack(
297251
{
298252
// ...
@@ -305,13 +259,12 @@ webpack(
305259

306260
console.log(
307261
stats.toString({
308-
chunks: false, // Makes the build much quieter
309-
colors: true, // Shows colors in the console
262+
chunks: false, // 使构建过程更静默无输出
263+
colors: true, // 在控制台展示颜色
310264
})
311265
);
312266
}
313267
);
314-
>>>>>>> 1bc7704750b8b2b27a168a9afc1bf9f070745f0e
315268
```
316269

317270
## MultiCompiler $#multicompiler$
@@ -352,15 +305,6 @@ W> 多个配置对象在执行时,**不会并行执行**。
352305
```js
353306
const webpack = require('webpack');
354307

355-
<<<<<<< HEAD
356-
webpack({
357-
// [配置对象](/configuration/)
358-
}, (err, stats) => {
359-
if (err) {
360-
console.error(err.stack || err);
361-
if (err.details) {
362-
console.error(err.details);
363-
=======
364308
webpack(
365309
{
366310
// ...
@@ -372,7 +316,6 @@ webpack(
372316
console.error(err.details);
373317
}
374318
return;
375-
>>>>>>> 1bc7704750b8b2b27a168a9afc1bf9f070745f0e
376319
}
377320

378321
const info = stats.toJson();

src/content/api/stats.mdx

Lines changed: 21 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -29,78 +29,44 @@ npx webpack --profile --json=compilation-stats.json
2929

3030
```json
3131
{
32-
<<<<<<< HEAD
33-
'version': '5.9.0', // 用来编译的 webpack 版本
34-
'hash': '11593e3b3ac85436984a', // 编译的特定哈希值
35-
'time': 2469, // 编译时间(毫秒)
36-
'publicPath': 'auto',
37-
'outputPath': '/', // webpack 的输出目录路径
38-
'assetsByChunkName': {
32+
"version": "5.9.0", // 用来编译的 webpack 版本
33+
"hash": "11593e3b3ac85436984a", // 编译的特定哈希值
34+
"time": 2469, // 编译时间(毫秒)
35+
"publicPath": "auto",
36+
"outputPath": "/", // webpack 的输出目录路径
37+
"assetsByChunkName": {
3938
// 输出资源对应的 Chunk 名称
40-
'main': [
41-
'web.js?h=11593e3b3ac85436984a'
39+
"main": [
40+
"web.js?h=11593e3b3ac85436984a"
4241
],
43-
'named-chunk': [
44-
'named-chunk.web.js'
42+
"named-chunk": [
43+
"named-chunk.web.js"
4544
],
46-
'other-chunk': [
47-
'other-chunk.js',
48-
'other-chunk.css'
45+
"other-chunk": [
46+
"other-chunk.js",
47+
"other-chunk.css"
4948
]
5049
},
51-
'assets': [
52-
// [asset objects](#asset-objects) 列表
53-
],
54-
'chunks': [
55-
// [chunk objects](#chunk-objects) 列表
56-
],
57-
'modules': [
58-
// [module objects](#module-objects) 列表
59-
],
60-
'entryPoints': {
61-
// [entry objects](#entry-objects) 列表
62-
},
63-
'errors': [
64-
// [error objects](#errors-and-warnings) 列表
65-
],
66-
'errorsCount': 0, // 错误个数
67-
'warnings': [
68-
// [warning objects](#errors-and-warnings) 列表
69-
],
70-
'warningsCount': 0, // 告警个数
71-
=======
72-
"version": "5.9.0", // Version of webpack used for the compilation
73-
"hash": "11593e3b3ac85436984a", // Compilation specific hash
74-
"time": 2469, // Compilation time in milliseconds
75-
"publicPath": "auto",
76-
"outputPath": "/", // path to webpack output directory
77-
"assetsByChunkName": {
78-
// Chunk name to emitted asset(s) mapping
79-
"main": ["web.js?h=11593e3b3ac85436984a"],
80-
"named-chunk": ["named-chunk.web.js"],
81-
"other-chunk": ["other-chunk.js", "other-chunk.css"]
82-
},
8350
"assets": [
84-
// A list of asset objects
51+
// asset objects 列表
8552
],
8653
"chunks": [
87-
// A list of chunk objects
54+
// chunk objects 列表
8855
],
8956
"modules": [
90-
// A list of module objects
57+
// module objects 列表
9158
],
9259
"entryPoints": {
93-
// A list of entry objects
60+
// entry objects 列表
9461
},
9562
"errors": [
96-
// A list of error objects
63+
// error objects 列表
9764
],
98-
"errorsCount": 0, // number of errors
65+
"errorsCount": 0, // 错误个数
9966
"warnings": [
100-
// A list of warning objects
67+
// warning objects 列表
10168
],
102-
"warningsCount": 0 // nummber of warnings
103-
>>>>>>> 1bc7704750b8b2b27a168a9afc1bf9f070745f0e
69+
"warningsCount": 0, // 告警个数
10470
}
10571
```
10672

0 commit comments

Comments
 (0)