mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
22 lines
557 B
JavaScript
22 lines
557 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)
|