Analyze Webpack Npm Packages File Size

September 16, 2017
Use webpack-bundle-analyzer

Install webpack-bundle-analyzer.

npm install --save-dev webpack-bundle-analyzer

Edit webpack config file.

const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin

module.exports = {
  ...
  plugins: [
    ...
    new BundleAnalyzerPlugin()
  ]
  ...
};

Output is generated at http://127.0.0.1:8888 as a graph to share breakdown of file size for each packages.

webpack-bundle-analyzer

This work is licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License.