Skip to content

Commit

Permalink
Fix bundle analyzer
Browse files Browse the repository at this point in the history
  • Loading branch information
AleksandrsKondratjevs committed Nov 8, 2022
1 parent fdabadb commit 8e87e7a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions packages/bundle-analyzer/build-config/analyzer.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
const { choosePort } = require('react-dev-utils/WebpackDevServerUtils');

module.exports = {
plugin: {
Expand All @@ -12,11 +11,10 @@ module.exports = {

const HOST = process.env.HOST || '0.0.0.0';
const DEFAULT_PORT = parseInt(process.env.PORT, 10) || 5000;
const analyzerPort = await choosePort(HOST, DEFAULT_PORT);

cracoConfig.webpack.plugins.push(new BundleAnalyzerPlugin({
analyzerHost: HOST,
analyzerPort,
analyzerPort: DEFAULT_PORT,
}));

return cracoConfig;
Expand Down

0 comments on commit 8e87e7a

Please sign in to comment.