Next.js: Turn off source maps by default

Created on 1 Feb 2017  路  6Comments  路  Source: vercel/next.js

Actually, here's my key points for this:

  • Babel errors (with HMR) works without source maps properly
  • Stack traces don't know how to handle source maps
  • This slows down the app by 4X or more (This is a big deal)
  • One can turn on source maps with our custom next.config.js

Most helpful comment

Another idea, for the dev build we can use https://github.com/babel/babel-preset-env to not to transpile a lot. So, we don't really need source maps.

All 6 comments

The only place it is needed is styled-jsx. To show styling locations. I'm not sure if this is related to webpack's sourcemaps though.

I think styled-jsx babel plugin does that. (not webpack)

Another idea, for the dev build we can use https://github.com/babel/babel-preset-env to not to transpile a lot. So, we don't really need source maps.

@arunoda do you have an example of how to turn on source maps with next.config.js?

Even source-maps add some(considerable) overhead. It's pretty useful when debugging the code.
So, I'll close this issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wagerfield picture wagerfield  路  3Comments

jesselee34 picture jesselee34  路  3Comments

renatorib picture renatorib  路  3Comments

pie6k picture pie6k  路  3Comments

rauchg picture rauchg  路  3Comments