Laravel-mix: [Feature Request] Add support for webpack-bundle-analyzer

Created on 6 Jul 2017  路  4Comments  路  Source: JeffreyWay/laravel-mix

It would really help if laravel-mix supported some kind of bundle analyzer.
Example of a bundle analyzer would be webpack-bundle-analyzer.

Most helpful comment

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...

All 4 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mementoneli picture mementoneli  路  3Comments

dtheb picture dtheb  路  3Comments

Micaso picture Micaso  路  3Comments

mstralka picture mstralka  路  3Comments

rlewkowicz picture rlewkowicz  路  3Comments