mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
334b46e8d9
* Add analyze-bundles example * housekeeping: with-webpack-bundle-analyzer example * analyze-bundles example: revert the version of faker library * analyze-bundles add analyze:server and analyze:browser to scripts * with-webpack-bundle-analyzer example: fix typo
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)
|