const { BundleAnalyzerPlugin } = require('../compiled/webpack-bundle-analyzer');
module.exports = async function addBundleAnalyzerPlugin(opts) {
const { config } = opts;
config.plugin('webpack-bundle-analyzer').use(BundleAnalyzerPlugin, [
{
analyzerMode: 'server',
analyzerPort: process.env.ANALYZE_PORT || 8888,
openAnalyzer: false,
logLevel: 'info',
defaultSizes: 'parsed',
},
]);
};
-
邓晓峰 authored80c1027b