next.js/test/integration/bundle-size-profiling/next.config.js
next.config.js20 lines482 B
module.exports = {
  webpack(config, options) {
    if (!options.isServer) {
      config.profile = true
      const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer')
      config.plugins.push(
        new BundleAnalyzerPlugin({
          generateStatsFile: true,
          analyzerMode: 'static',
          reportFilename: options.isServer
            ? '../analyze/server.html'
            : './analyze/client.html',
        })
      )
    }

    return config
  },
}
Quest for Codev2.0.0
/
SIGN IN