Skip to content

Commit 6af58aa

Browse files
committed
fix: send sourcemaps separately and do not include sourcemaps in prod code
1 parent ccb097b commit 6af58aa

3 files changed

Lines changed: 17 additions & 3 deletions

File tree

docker/Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,20 @@ RUN yarn set version berry && yarn install --immutable
2323
ENV NODE_ENV=production
2424
COPY . .
2525
RUN yarn build-ts
26+
27+
# -------------------------------------------------------
28+
FROM base AS build-sources
29+
30+
WORKDIR /app
31+
COPY package.json yarn.lock .yarnrc.yml ./
32+
# We need a specific command because we need to copy the folder with it, not just the content.
33+
COPY .yarn/releases ./.yarn/releases/
34+
RUN yarn set version berry && yarn install --immutable
35+
36+
ENV NODE_ENV=production
37+
COPY . .
38+
RUN yarn build-ts --sourceMap true --sourceRoot '/'
39+
2640
# send sourcemaps to Sentry
2741
RUN --mount=type=secret,id=SENTRY_AUTH_TOKEN,env=SENTRY_AUTH_TOKEN yarn sentry:sourcemaps
2842

tsconfig.build.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"extends": "./tsconfig.json",
33
"compilerOptions": {
44
"noEmit": false,
5-
"outDir": "dist"
5+
"outDir": "dist",
6+
"sourceMap": false
67
},
78
"exclude": [
89
"node_modules",

tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,10 @@
2828
"./src/@types/*"
2929
],
3030
"sourceMap": true,
31-
"inlineSources": true,
3231
// Set `sourceRoot` to "/" to strip the build path prefix
3332
// from generated source code references.
3433
// This improves issue grouping in Sentry.
35-
"sourceRoot": "/"
34+
// "sourceRoot": "/"
3635
},
3736
"include": [
3837
"src/**/*",

0 commit comments

Comments
 (0)