Skip to content

Instantly share code, notes, and snippets.

@JamieMason
Last active November 18, 2023 14:40
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JamieMason/e9a582e9299ad6b117b8fd7f8c9ad530 to your computer and use it in GitHub Desktop.
Save JamieMason/e9a582e9299ad6b117b8fd7f8c9ad530 to your computer and use it in GitHub Desktop.
Next.js chrome devtools coverage settings

Next.js chrome devtools coverage settings

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
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment