Skip to content

Commit

Permalink
Add bundle analyzer
Browse files Browse the repository at this point in the history
  • Loading branch information
sauntimo committed Jan 13, 2025
1 parent 30b6fb7 commit 42876b2
Show file tree
Hide file tree
Showing 4 changed files with 296 additions and 98 deletions.
10 changes: 9 additions & 1 deletion build/webpack/config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const StatsWriterPlugin = require('webpack-stats-plugin').StatsWriterPlugin;
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const TerserPlugin = require('terser-webpack-plugin');
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;

const project = require('../../package.json');
const config = require('./config.base.js');
Expand Down Expand Up @@ -80,7 +81,14 @@ config.plugins = [
return JSON.stringify(chunks);
}
}),
new NodePolyfillPlugin()
new NodePolyfillPlugin(),
new BundleAnalyzerPlugin({
reportFilename: 'report.html',
statsFilename: 'stats.json',
analyzerMode: 'static',
generateStatsFile: true,
statsOptions: { source: false }
})
];

config.optimization = {
Expand Down
Loading

0 comments on commit 42876b2

Please sign in to comment.