Skip to content

Improve documentation for --profile #1343

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 29, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion content/api/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -289,11 +289,27 @@ These options allow webpack to display various [stats](/configuration/stats/) an

### Profiling

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.
The `--profile` option captures timing information for each step of the compilation and includes this in the output.

```bash
webpack --profile

[0] ./src/index.js 90 bytes {0} [built]
factory:22ms building:16ms = 38ms
```

For each module, the following details are included in the output as applicable:

* `factory`: time to collect module metadata (e.g. resolving the filename)
* `building`: time to build the module (e.g. loaders and parsing)
* `dependencies`: time to identify and connect the module’s dependencies

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.

```bash
webpack --progress --profile

30ms building modules
1ms sealing
1ms optimizing
Expand All @@ -319,4 +335,5 @@ webpack --profile
26ms chunk asset optimization
1ms asset optimization
6ms emitting
```