Should I deploy sourcemaps to production?
Asked Answered
S

1

30

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?

Sacrum answered 4/10, 2017 at 16:33 Comment(2)
IMO no, you'd should be debugging stuff in dev or maybe even stagingKletter
See also #27346020 And #44336528Buseck
D
38

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.

Davin answered 4/10, 2017 at 17:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.