Add SpeedMeasurePlugin to measure the speed of webpack builds (#2051)

This commit is contained in:
Risha Mars 2019-01-08 20:41:49 -05:00 committed by Kevin Lingerfelt
parent 3b6d02a4b6
commit db0876a039
3 changed files with 15 additions and 3 deletions

View File

@ -53,6 +53,7 @@
"react-test-renderer": "16.5.2",
"sinon": "7.0.0",
"sinon-stub-promise": "4.0.0",
"speed-measure-webpack-plugin": "^1.2.5",
"style-loader": "0.21.0",
"url-loader": "1.0.1",
"webpack": "4.20.2",

View File

@ -3,10 +3,14 @@
const path = require('path');
const LodashModuleReplacementPlugin = require('lodash-webpack-plugin');
// uncomment here and in plugins to analyze bundle size
// analyze plugin speeds
const SpeedMeasurePlugin = require("speed-measure-webpack-plugin");
const smp = new SpeedMeasurePlugin();
// uncomment here and in plugins to analyze webpack bundle size
// const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
module.exports = {
module.exports = smp.wrap({
mode: process.env.NODE_ENV === 'production' ? 'production' : 'development',
entry: './js/index.js',
output: {
@ -66,4 +70,4 @@ module.exports = {
'paths': true
})
]
}
});

View File

@ -8149,6 +8149,13 @@ spdy@^3.4.1:
select-hose "^2.0.0"
spdy-transport "^2.0.18"
speed-measure-webpack-plugin@^1.2.5:
version "1.2.5"
resolved "https://registry.yarnpkg.com/speed-measure-webpack-plugin/-/speed-measure-webpack-plugin-1.2.5.tgz#8179936eb8c5e891f7481bd5075a9ea9a0f74823"
integrity sha512-S/guYjC4Izn5wY2d0+M4zowED/F77Lxh9yjkTZ+XAr244pr9c1MYNcXcRe9lx2hmAj0GPbOrBXgOF2YIp/CZ8A==
dependencies:
chalk "^2.0.1"
split-string@^3.0.1, split-string@^3.0.2:
version "3.1.0"
resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2"