1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00
next.js/examples/with-webpack-bundle-analyzer/next.config.js
Tim Neutkens ff547752f0 Fix HMR issue with webpack-stats-analyzer (#1149)
* Use stats.json instead of running server

* Add suggested changes
2017-02-15 21:42:48 +09:00

18 lines
544 B
JavaScript

const {BundleAnalyzerPlugin} = require('webpack-bundle-analyzer')
module.exports = {
webpack: (config, { dev }) => {
// Perform customizations to config
config.plugins.push(
new BundleAnalyzerPlugin({
analyzerMode: 'disabled',
// For all options see https://github.com/th0r/webpack-bundle-analyzer#as-plugin
generateStatsFile: true,
// Will be available at `.next/stats.json`
statsFilename: 'stats.json'
})
)
// Important: return the modified config
return config
}
}