webpack-bundle-analyzer-json
v2.15.5
Published
Webpack plugin and CLI utility that represents bundle content as convenient interactive zoomable treemap
Downloads
7
Readme
Webpack Bundle Analyzer JSON plugin
Analyzer that generates a JSON report containing chunks data converted from bytes into appropriate units according to the filesize provided API.
Great thanks
Webpack Bundle Analyzer JSON plugin is built on a base of webpack-bundle-analyzer and @jasperck/webpack-bundle-analyzer plugins.
Install
npm install --save-dev webpack-bundle-analyzer-json
Usage (as a plugin)
const BundleAnalyzerJsonPlugin = require('webpack-bundle-analyzer-json').BundleAnalyzerJsonPlugin;
module.exports = {
plugins: [
new BundleAnalyzerJsonPlugin({
reportFilename: 'file-path'
})
]
}
Analyzer will generate a JSON report containing chunks (.js, .css) data converted from bytes into appropriate units according to the filesize provided API.
Result
[
{
"label": "scripts/Drawer.js",
"parsedSize": "7.16 KB",
"gzipSize": "2.56 KB",
"chunkNames": [
"Drawer"
],
"statSize": "13.67 KB",
},
{
"label": "scripts/Checkout.js",
"parsedSize": "47.43 KB",
"gzipSize": "14.62 KB",
"chunkNames": [
"Checkout"
],
"statSize": "113.11 KB",
},
{
"label": "Drawer.css",
"parsedSize": "53.11 KB",
"gzipSize": "11.03 KB",
"chunkNames": [
"Drawer"
]
},
{
"label": "Checkout.css",
"parsedSize": "24.63 KB",
"gzipSize": "4.97 KB",
"chunkNames": [
"Checkout"
]
},
]
License
MIT (http://www.opensource.org/licenses/mit-license.php)