Skip to content

Commit

Permalink
docs(plugins): add ProfilingPlugin documentation (#1830)
Browse files Browse the repository at this point in the history
  • Loading branch information
EugeneHlushko authored and skipjack committed Feb 23, 2018
1 parent acf7b77 commit 7b89b9f
Showing 1 changed file with 33 additions and 0 deletions.
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!

0 comments on commit 7b89b9f

Please sign in to comment.