It would really help if laravel-mix supported some kind of bundle analyzer.
Example of a bundle analyzer would be webpack-bundle-analyzer.
You can pull this in manually, using mix.webpackConfig(), but I don't have plans to make it part of Mix's core right now.
Here is a quick example on how to achieve this :
webpack.mix.js :
const mix = require('laravel-mix');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
mix.webpackConfig({
plugins: [
new BundleAnalyzerPlugin(),
],
});
// etc...
@wmcmurray link is broken
Thanks @InstanceOfMichael , I edited my comment with an example taken from a project of mine instead.
Most helpful comment
Here is a quick example on how to achieve this :
webpack.mix.js: