Hey SST community :wave: I am wondering how I can...
# help
h
Hey SST community 👋 I am wondering how I can disable sourcemaps in prod. Does it automatically get disabled if the stage is prod ?
f
Hey @Hamed Mamdoohi, let me pull in @thdxr. I see we have a relevant issue marked closed here. I will let Dax confirm. https://github.com/serverless-stack/serverless-stack/issues/701
t
That actually doesn't let you disable - we have a seperate issue for it. However I want to understand why you want to disable sourcemaps in prod? It's still useful to have proper stack traces in your logs / error reporting isn't it?
h
We do use logger and observability tools for tracing errors. I think sourcemaps can add up to the bundle size. Let me check with the team. They might have better insight as to why we have been disabling sourcemaps
t
Yeah they do add to the bundle size but we generally recommend leaving them in
We do need to support disabling them for people who ship them to an external tool like Sentry at build time
h
Hey @thdxr thanks for this. I spoke with the team. We are happy to keep sourcemaps as is as in prod for the reasons you pointed out. Please disregard my request here 🙏
t
Note they actually don't work out of the box right now, we have a PR open to fix that. Need to pass an env variable to NODE_OPTIONS