From 7b89b9f3f49c5fb83bbe7cd2f5665387754848d8 Mon Sep 17 00:00:00 2001 From: Eugene Hlushko Date: Fri, 23 Feb 2018 06:34:54 +0200 Subject: [PATCH] docs(plugins): add `ProfilingPlugin` documentation (#1830) --- src/content/plugins/profiling-plugin.md | 33 +++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/content/plugins/profiling-plugin.md diff --git a/src/content/plugins/profiling-plugin.md b/src/content/plugins/profiling-plugin.md new file mode 100644 index 000000000000..4968686ea666 --- /dev/null +++ b/src/content/plugins/profiling-plugin.md @@ -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!