By default, the CLI webpack will print the path of all included modules and their corresponding size.
Webpack can also generate a stats.json file for you, which contains information about each module included in your assembly.
In the CLI:
webpack --json > stats.json
From the NodeJS API:
webpack(config, function(err, stats) { fs.writeFileSync('./stats.json', JSON.stringify(stats.toJson())); });
Then you can either write your own statistics analyzer tool, or use existing tools such as a great web page statistics analyzer .
Alexandre Kirszenberg
source share