1
0
Fork 0
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:
Juan Campa 2018-02-05 23:18:38 -08:00 committed by Arunoda Susiripala
parent 905ff32b7f
commit efed85e495

View file

@ -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
})) }))
} }