Commit efed85e4 authored by Juan Campa's avatar Juan Campa Committed by Arunoda Susiripala

Fix webpack-bundle-analyzer example to work with Next 5 (#3692)

parent 905ff32b
...@@ -2,11 +2,11 @@ const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer') ...@@ -2,11 +2,11 @@ const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer')
const { ANALYZE } = process.env const { ANALYZE } = process.env
module.exports = { module.exports = {
webpack: function (config) { webpack: function (config, { isServer }) {
if (ANALYZE) { if (ANALYZE) {
config.plugins.push(new BundleAnalyzerPlugin({ config.plugins.push(new BundleAnalyzerPlugin({
analyzerMode: 'server', analyzerMode: 'server',
analyzerPort: 8888, analyzerPort: isServer ? 8888 : 8889,
openAnalyzer: true openAnalyzer: true
})) }))
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment