Added webpack asset size analyzer.

This commit is contained in:
Jan Böhmer 2020-06-13 21:24:24 +02:00
parent 37acc82b2f
commit a846f373c0
4 changed files with 93 additions and 10 deletions

View file

@ -24,6 +24,7 @@ const CopyPlugin = require('copy-webpack-plugin');
const zlib = require('zlib');
const CompressionPlugin = require("compression-webpack-plugin");
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
// Manually configure the runtime environment if not already configured yet by the "encore" command.
// It's useful when you use tools that rely on webpack.config.js file.
@ -135,4 +136,9 @@ if (Encore.isProduction()) {
}))
}
if (Encore.isDev()) {
Encore.addPlugin(new BundleAnalyzerPlugin());
}
module.exports = Encore.getWebpackConfig();