diff --git a/test/integration/bundle-size-profiling/next.config.js b/test/integration/bundle-size-profiling/next.config.js new file mode 100644 index 0000000000000..4d15dcc1bb368 --- /dev/null +++ b/test/integration/bundle-size-profiling/next.config.js @@ -0,0 +1,22 @@ +module.exports = { + experimental: { + polyfillsOptimization: true, + }, + 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 + }, +} diff --git a/test/integration/bundle-size-profiling/pages/index.js b/test/integration/bundle-size-profiling/pages/index.js new file mode 100644 index 0000000000000..77346cb4003c7 --- /dev/null +++ b/test/integration/bundle-size-profiling/pages/index.js @@ -0,0 +1 @@ +export default () => 'Hello World'