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
|
||||
|
||||
module.exports = {
|
||||
webpack: function (config) {
|
||||
webpack: function (config, { isServer }) {
|
||||
if (ANALYZE) {
|
||||
config.plugins.push(new BundleAnalyzerPlugin({
|
||||
analyzerMode: 'server',
|
||||
analyzerPort: 8888,
|
||||
analyzerPort: isServer ? 8888 : 8889,
|
||||
openAnalyzer: true
|
||||
}))
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue