I found these settings really useful when using the Chrome Devtools Coverage Inspector to look for unused JavaScript in a Next.js App.
Build the app for production with these settings and the output will be easier to debug.
// next.config.js
module.exports = {
webpack(config) {
config.optimization.chunkIds = 'named'
config.optimization.mangleExports = false
config.optimization.minimize = false
config.optimization.minimizer = []
config.optimization.moduleIds = 'named'
return config
}
}