webpack-node-modules-analyzer
v1.0.7
Published
Analyze node_modules in webpack bundle, and make it visualize
Readme
webpack-node-modules-analyzer
Analyze node_modules in webpack bundle, and make it visualize
Install
# By npm
$ npm install webpack-node-modules-analyzer -g
# Or by yarn
$ yarn global add webpack-node-modules-analyzerUsage
$ node-modules-analyzer -s stats.json -r report.json -o <outputFile>
stats.jsonandreport.jsonare generated by webpack-bundle-analyzer
webpack-bundle-analyzer plugin config
in webpack.config.js
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
module.exports = {
...,
plugins: [
...,
new BundleAnalyzerPlugin({
analyzerMode: 'json',
generateStatsFile: true
})
]
}After webpack build, stats.json and report.json will be generated in the build dir.
Output
Use --output or -o option to output file, it support .html and .json file type.
List packages
Use --list or -l option to list the packages required by files which is not npm module.
And use --gt option to filter list packages which size greater then it.
