mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
Fix webpack-bundle-analyzer example to work with Next 5 (#3692)
This commit is contained in:
parent
905ff32b7f
commit
efed85e495
|
@ -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
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue