From b52643a716f752b9f4dd1fa32e8d66a5f603b978 Mon Sep 17 00:00:00 2001 From: EugeneHlushko Date: Wed, 14 Feb 2018 10:28:25 +0200 Subject: [PATCH 1/4] ProfilingPlugin: add to the docs --- src/content/plugins/profiling-plugin.md | 41 +++++++++++++++++++++++++ 1 file changed, 41 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..225c0da5d7ab --- /dev/null +++ b/src/content/plugins/profiling-plugin.md @@ -0,0 +1,41 @@ +--- +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 +module.exports = { + // ... + plugins: [ + new webpack.debug.ProfilingPlugin() + ] +} +``` + +## Usage: custom `outputPath` + +``` js +module.exports = { + // .. + plugins: [ + 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` +- can drag and drop generated file (`events.json` by default) into the profiler. It will then display timeline stats and calls per plugin! From db77a55db2aa7f048e70e23337fe556855df63e9 Mon Sep 17 00:00:00 2001 From: EugeneHlushko Date: Wed, 14 Feb 2018 10:30:16 +0200 Subject: [PATCH 2/4] ProfilingPlugin: add to the docs: small corrections --- src/content/plugins/profiling-plugin.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/content/plugins/profiling-plugin.md b/src/content/plugins/profiling-plugin.md index 225c0da5d7ab..d0a18c452864 100644 --- a/src/content/plugins/profiling-plugin.md +++ b/src/content/plugins/profiling-plugin.md @@ -36,6 +36,6 @@ module.exports = { In order to view the profile file: -- run webpack with `ProfilingPlugin` -- go to Chrome, open the `Profile Tab` -- can drag and drop generated file (`events.json` by default) into the profiler. It will then display timeline stats and calls per plugin! +- 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! From 668876708f3b65e8e9b9247a1156b824c2bf7529 Mon Sep 17 00:00:00 2001 From: EugeneHlushko Date: Wed, 14 Feb 2018 10:36:48 +0200 Subject: [PATCH 3/4] ProfilingPlugin: add to the docs: remove redundant code from examples --- src/content/plugins/profiling-plugin.md | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/src/content/plugins/profiling-plugin.md b/src/content/plugins/profiling-plugin.md index d0a18c452864..ad6d27826750 100644 --- a/src/content/plugins/profiling-plugin.md +++ b/src/content/plugins/profiling-plugin.md @@ -13,25 +13,15 @@ Generate Chrome profile file which includes timings of plugins execution. Output ## Usage: default ``` js -module.exports = { - // ... - plugins: [ - new webpack.debug.ProfilingPlugin() - ] -} +new webpack.debug.ProfilingPlugin() ``` ## Usage: custom `outputPath` ``` js -module.exports = { - // .. - plugins: [ - new webpack.debug.ProfilingPlugin({ - outputPath: "profiling/profileEvents.json" - }) - ] -} +new webpack.debug.ProfilingPlugin({ + outputPath: "profiling/profileEvents.json" +}) ``` In order to view the profile file: From 653f812560975ac49d5fb646e7b6713ab1883b67 Mon Sep 17 00:00:00 2001 From: EugeneHlushko Date: Mon, 19 Feb 2018 10:43:08 +0200 Subject: [PATCH 4/4] ProfilingPlugin: add to the docs: Peer review updates --- src/content/plugins/profiling-plugin.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/content/plugins/profiling-plugin.md b/src/content/plugins/profiling-plugin.md index ad6d27826750..4968686ea666 100644 --- a/src/content/plugins/profiling-plugin.md +++ b/src/content/plugins/profiling-plugin.md @@ -26,6 +26,8 @@ new webpack.debug.ProfilingPlugin({ 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! +- 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!