stats option controls what bundle information gets displayed in the console after compilation. It can also be used to generate detailed JSON output for analysis.
Basic Configuration
webpack.config.js
Stats Presets
Control stats output.
Preset Strings
errors-only
errors-only
Only output when errors happen.Perfect for CI/CD pipelines.
errors-warnings
errors-warnings
Only output errors and warnings.Good balance for production builds.
minimal
minimal
Only output when errors or new compilation happens.Clean output with essential information.
normal
normal
Standard output (default).Shows assets, chunks, modules, and errors/warnings.
detailed
detailed
Output everything except chunkModules and chunkRootModules.More information than normal.
verbose
verbose
Output everything.Maximum information for debugging.
none or false
none or false
No output.Completely silent.
summary
summary
Output only webpack version, warnings count, and errors count.
Stats Object Options
Customize what information is displayed:Assets
Assets Information
Assets Information
Show assets information.Default:
trueSort assets by field.
Space to display assets.
Exclude assets from being displayed.
Show cached (not emitted) assets.Default:
trueModules
Modules Information
Modules Information
Show modules information.Default:
trueSort modules by field.
Space to display modules.
Exclude modules from being displayed.
Show cached (not built) modules.
Chunks
Chunks Information
Chunks Information
Errors and Warnings
Errors and Warnings
Errors and Warnings
Show errors.Default:
trueShow errors count.
Show details for errors.
Show warnings.Default:
trueShow warnings count.
Filter warnings to be shown.
Other Options
Display Options
Display Options
Enable/disable colors in output.Default:
false (auto-detected in terminal)Show compilation hash.
Show webpack version.
Show timing information.
Show build timestamp.
Show entry points.
Grouping Options
Grouping Options
Common Configurations
Development
webpack.dev.js
Production
webpack.prod.js
CI/CD
webpack.config.js
Detailed Analysis
webpack.config.js
JSON Stats Output
Generate detailed JSON statistics:Stats Utilities
webpack-bundle-analyzer
Visualize bundle content:webpack-visualizer
Online tool at https://chrisbateman.github.io/webpack-visualizer/ Upload your stats.json file.webpack-chart
Online tool at https://alexkuz.github.io/webpack-chart/DevServer Stats
Configure stats for dev server:webpack.config.js
Infrastructure Logging
Control webpack’s internal logging:webpack.config.js
Performance Tips
Reduce Stats Size
Focus on Errors
Environment-Based Stats
webpack.config.js
Custom Stats Output
webpack.config.js
Package.json Scripts
package.json