26

I'm deploying my website - a static site built in GatsbyJS - and my sourcemaps are by far my largest files. I have 3 sourcemap files that are ~ 3MB. Overall they make up maybe 70% of my build.

  • Should I deploy them to my production server?

  • Are sourcemaps only downloaded by users that open devtools?

lealceldeiro
  • 14,342
  • 6
  • 49
  • 80
Paul N
  • 513
  • 1
  • 5
  • 11
  • 1
    IMO no, you'd should be debugging stuff in dev or maybe even staging – MinusFour Oct 04 '17 at 16:35
  • 1
    See also https://stackoverflow.com/questions/27345520/source-maps-files-in-production-is-it-safe And https://stackoverflow.com/questions/44336028/any-legitimate-security-concern-with-making-javascript-source-map-public – Michael Freidgeim Aug 07 '21 at 13:21

1 Answers1

32

Considering what a source map is you just need to take into account that:

But, of course, you might need them on production mode in case you need to debug your application (on production mode, since they are not needed for debugging purposes on development mode) (See Source maps files in production - Is it safe? and Why use source maps in production?).

So, this decision is completely up to you according to your needs and requirements, having in mind the previously mentioned points.

lealceldeiro
  • 14,342
  • 6
  • 49
  • 80