Commit a59e668
authored
fix(dotcom): serve source maps instead of stripping them from the deploy (tldraw#9327)
In order to make deployed tldraw.com builds debuggable in browser
devtools and stop the source-map 404s, this PR stops stripping `.js.map`
files from the client deploy and serves them publicly. Closes tldraw#9322.
The client build generated source maps, uploaded them to Sentry, then
deleted the `.js.map` files from the deployed assets — while leaving the
`//# sourceMappingURL` comments in the shipped JS. That produced a 404
for every map and left browser devtools unable to symbolicate deployed
builds. The usual reason to hide source maps is to keep source private,
which does not apply here since the client source is public in this
repo. Sentry upload is unaffected: it reads from `dist/assets` before
the strip step.
### Change type
- [x] `bugfix`
### Test plan
1. From the preview deploy, open devtools → Network, reload, and confirm
`*.js.map` requests return 200 rather than 404.
2. Open a minified stack frame in devtools and confirm it symbolicates
to real names and lines.
### Code changes
| Section | LOC change |
| -------------- | ---------- |
| Config/tooling | +7 / -3 |1 parent 88bcbe5 commit a59e668
1 file changed
Lines changed: 7 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | 4 | | |
6 | 5 | | |
7 | 6 | | |
| |||
53 | 52 | | |
54 | 53 | | |
55 | 54 | | |
56 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
57 | 59 | | |
58 | 60 | | |
59 | 61 | | |
| |||
92 | 94 | | |
93 | 95 | | |
94 | 96 | | |
95 | | - | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
96 | 100 | | |
97 | 101 | | |
98 | 102 | | |
| |||
0 commit comments