laravel-mix-bundle-analyzer
Version:
A Laravel Mix extension for Webpack bundle analyzer support.
24 lines (18 loc) • 487 B
JavaScript
const mix = require('laravel-mix');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
/**
* Add isWatching helper
*/
require('./isWatching');
class BundleAnalyzer {
register (options = {}) {
this.options = options;
}
dependencies () {
return ['webpack-bundle-analyzer'];
}
webpackPlugins () {
return new BundleAnalyzerPlugin(this.options);
}
}
mix.extend('bundleAnalyzer', new BundleAnalyzer());