Prints the gzipped sizes of your webpack assets and the changes since the last build.
Install size-plugin
as a development dependency using npm:
npm i -D size-plugin
Add an instance of the plugin to your webpack configuration:
// webpack.config.js
+ const SizePlugin = require('size-plugin');
module.exports = {
plugins: [
+ new SizePlugin()
]
}
This option will store a json file with the history of your build that you then can use to do bundle analysis over a period of time
// webpack.config.js
const SizePlugin = require('size-plugin');
module.exports = {
plugins: [
new SizePlugin({
json: true,
filename: 'report.json' // Relative to where webpack is ran
})
]
}
This is not an official Google product.