Skip to content

Commit

Permalink
Merge pull request scandipwa#5295 from AleksandrsKondratjevs/issue-5294
Browse files Browse the repository at this point in the history
issue-5294 - Fix bundle analyzer
  • Loading branch information
AleksandrsKondratjevs authored Nov 11, 2022
2 parents 69c6850 + 8e87e7a commit 2e15f55
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 2e15f55

Please sign in to comment.