Output webpack stats with webpack-cli

Step 1. Configure webpack stats options

// webpack.config.js
{
  stats: {
    context: './src', // optional, will improve readability of the paths
    assets: true,
    entrypoints: true,
    chunks: true,
    modules: true
  }
}

Step 2. Output webpack stats JSON file

webpack --mode=production --profile --json > artifacts/webpack-stats.json



Need help?Contact us via email, Twitter, or Github!