You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(api): improve documentation for --profile (#1343)
The sample output that was previously shown for `--profile` will not
appear unless `--progress` is also used. This change spells this out,
and also describes the per-module timings that `--profile`
produces by itself.
Copy file name to clipboardExpand all lines: content/api/cli.md
+18-1Lines changed: 18 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -289,11 +289,27 @@ These options allow webpack to display various [stats](/configuration/stats/) an
289
289
290
290
### Profiling
291
291
292
-
This option profiles the compilation and includes this information in the stats output. It gives you an in depth idea of which step in the compilation is taking how long. This can help you optimise your build in a more informed manner.
292
+
The `--profile`option captures timing information for each step of the compilation and includes this in the output.
293
293
294
294
```bash
295
295
webpack --profile
296
296
297
+
⋮
298
+
[0] ./src/index.js 90 bytes {0} [built]
299
+
factory:22ms building:16ms = 38ms
300
+
```
301
+
302
+
For each module, the following details are included in the output as applicable:
303
+
304
+
*`factory`: time to collect module metadata (e.g. resolving the filename)
305
+
*`building`: time to build the module (e.g. loaders and parsing)
306
+
*`dependencies`: time to identify and connect the module’s dependencies
307
+
308
+
Paired with `--progress`, `--profile` gives you an in depth idea of which step in the compilation is taking how long. This can help you optimise your build in a more informed manner.
0 commit comments