mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
b5fa6c5969
c.f. https://github.com/zeit/next-plugins/blob/master/packages/next-bundle-analyzer/readme.md
22 lines
558 B
JavaScript
22 lines
558 B
JavaScript
const withBundleAnalyzer = require('@zeit/next-bundle-analyzer')
|
|
|
|
const nextConfig = {
|
|
analyzeServer: ['server', 'both'].includes(process.env.BUNDLE_ANALYZE),
|
|
analyzeBrowser: ['browser', 'both'].includes(process.env.BUNDLE_ANALYZE),
|
|
bundleAnalyzerConfig: {
|
|
server: {
|
|
analyzerMode: 'static',
|
|
reportFilename: '../bundles/server.html'
|
|
},
|
|
browser: {
|
|
analyzerMode: 'static',
|
|
reportFilename: '../bundles/client.html'
|
|
}
|
|
},
|
|
webpack (config) {
|
|
return config
|
|
}
|
|
}
|
|
|
|
module.exports = withBundleAnalyzer(nextConfig)
|