Skip to content
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

ProfilingPlugin: add to the docs #1830

Merged
merged 4 commits into from
Feb 23, 2018
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
33 changes: 33 additions & 0 deletions src/content/plugins/profiling-plugin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
title: ProfilingPlugin
contributors:
- EugeneHlushko
---

Generate Chrome profile file which includes timings of plugins execution. Outputs `events.json` file by default. It is possible to provide custom file path using `outputPath` option.

## Options

- `outputPath`: A relative path to a custom output file (json)

## Usage: default

``` js
new webpack.debug.ProfilingPlugin()
```

## Usage: custom `outputPath`

``` js
new webpack.debug.ProfilingPlugin({
outputPath: "profiling/profileEvents.json"
})
```

In order to view the profile file:

- Run webpack with `ProfilingPlugin`.
- Go to Chrome, open the `Profile Tab`.
- Drag and drop generated file (`events.json` by default) into the profiler.

It will then display timeline stats and calls per plugin!