diff --git a/examples/with-webpack-bundle-analyzer/next.config.js b/examples/with-webpack-bundle-analyzer/next.config.js index 1bdbe095..0ebbfb61 100644 --- a/examples/with-webpack-bundle-analyzer/next.config.js +++ b/examples/with-webpack-bundle-analyzer/next.config.js @@ -1,9 +1,10 @@ -const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer') const { ANALYZE } = process.env module.exports = { webpack: function (config, { isServer }) { if (ANALYZE) { + const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer') + config.plugins.push(new BundleAnalyzerPlugin({ analyzerMode: 'server', analyzerPort: isServer ? 8888 : 8889,