Skip to content

Commit 71c789b

Browse files
authored
docs(sourceMaps): Add filesToDeleteAfterUpload when source maps are enabled (#15609)
## DESCRIBE YOUR PR Follow-up on this PR: #15574 In snippets, where source maps are enabled, the `filesToDeleteAfterUpload` option is added as well. Also, the section about adding this option is added as a warning, not a simple note. ## IS YOUR CHANGE URGENT? Help us prioritize incoming PRs by letting us know when the change needs to go live. - [ ] Urgent deadline (GA date, etc.): <!-- ENTER DATE HERE --> - [ ] Other deadline: <!-- ENTER DATE HERE --> - [ ] None: Not urgent, can wait up to 1 week+ ## SLA - Teamwork makes the dream work, so please add a reviewer to your PRs. - Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it. Thanks in advance for your help! ## PRE-MERGE CHECKLIST *Make sure you've checked the following before merging your changes:* - [ ] Checked Vercel preview for correctness, including links - [ ] PR was reviewed and approved by any necessary SMEs (subject matter experts) - [ ] PR was reviewed and approved by a member of the [Sentry docs team](https://github.com/orgs/getsentry/teams/docs)
1 parent 97711fe commit 71c789b

File tree

21 files changed

+170
-37
lines changed

21 files changed

+170
-37
lines changed

docs/platforms/javascript/common/sourcemaps/uploading/angular-nx.mdx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,19 @@ module.exports = {
9696
org: "___ORG_SLUG___",
9797
project: "___PROJECT_SLUG___",
9898
authToken: process.env.SENTRY_AUTH_TOKEN,
99+
100+
sourcemaps: {
101+
// As you're enabling client source maps, you probably want to delete them after they're uploaded to Sentry.
102+
// Set the appropriate glob pattern for your output folder - some glob examples below:
103+
filesToDeleteAfterUpload: ["./**/*.map", ".*/**/public/**/*.map", "./dist/**/client/**/*.map"]
104+
}
99105
}),
100106
],
101107
};
102108
```
103109

104-
<Alert>
105-
Generating sourcemaps may expose them to the public, potentially causing your
110+
<Alert level="warning">
111+
Generating source maps **may expose them to the public**, potentially causing your
106112
source code to be leaked. You can prevent this by configuring your server to
107113
deny access to `.js.map` files, or by using [Sentry Webpack Plugin's
108114
`sourcemaps.filesToDeleteAfterUpload`](https://www.npmjs.com/package/@sentry/webpack-plugin#sourcemapsfilestodeleteafterupload)
@@ -151,8 +157,8 @@ Then, follow the [official Nx documentation](https://nx.dev/nx-api/angular/execu
151157
}
152158
```
153159

154-
<Alert>
155-
Generating sourcemaps may expose them to the public, potentially causing your
160+
<Alert level="warning">
161+
Generating source maps **may expose them to the public**, potentially causing your
156162
source code to be leaked. You can prevent this by configuring your server to
157163
deny access to `.js.map` files, or by using [Sentry Esbuild Plugin's
158164
`sourcemaps.filesToDeleteAfterUpload`](https://www.npmjs.com/package/@sentry/esbuild-plugin#sourcemapsfilestodeleteafterupload)

docs/platforms/javascript/common/sourcemaps/uploading/angular-webpack.mdx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,12 @@ module.exports = {
108108
org: "___ORG_SLUG___",
109109
project: "___PROJECT_SLUG___",
110110
authToken: process.env.SENTRY_AUTH_TOKEN,
111+
112+
sourcemaps: {
113+
// As you're enabling client source maps, you probably want to delete them after they're uploaded to Sentry.
114+
// Set the appropriate glob pattern for your output folder - some glob examples below:
115+
filesToDeleteAfterUpload: ["./**/*.map", ".*/**/public/**/*.map", "./dist/**/client/**/*.map"]
116+
}
111117
}),
112118
],
113119
};
@@ -130,8 +136,8 @@ We recommend running a production build to test your implementation.
130136

131137
</Alert>
132138

133-
<Alert>
134-
Generating sourcemaps may expose them to the public, potentially causing your
139+
<Alert level="warning">
140+
Generating source maps **may expose them to the public**, potentially causing your
135141
source code to be leaked. You can prevent this by configuring your server to
136142
deny access to `.js.map` files, or by using [Sentry Webpack Plugin's
137143
`sourcemaps.filesToDeleteAfterUpload`](https://www.npmjs.com/package/@sentry/webpack-plugin#sourcemapsfilestodeleteafterupload)

docs/platforms/javascript/common/sourcemaps/uploading/esbuild.mdx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,19 @@ require("esbuild").build({
8888
org: "___ORG_SLUG___",
8989
project: "___PROJECT_SLUG___",
9090
authToken: process.env.SENTRY_AUTH_TOKEN,
91+
92+
sourcemaps: {
93+
// As you're enabling client source maps, you probably want to delete them after they're uploaded to Sentry.
94+
// Set the appropriate glob pattern for your output folder - some glob examples below:
95+
filesToDeleteAfterUpload: ["./**/*.map", ".*/**/public/**/*.map", "./dist/**/client/**/*.map"]
96+
}
9197
}),
9298
],
9399
});
94100
```
95101

96-
<Alert>
97-
Generating sourcemaps may expose them to the public, potentially causing your
102+
<Alert level="warning">
103+
Generating source maps **may expose them to the public**, potentially causing your
98104
source code to be leaked. You can prevent this by configuring your server to
99105
deny access to `.js.map` files, or by using [Sentry Esbuild Plugin's
100106
`sourcemaps.filesToDeleteAfterUpload`](https://www.npmjs.com/package/@sentry/esbuild-plugin#sourcemapsfilestodeleteafterupload)

docs/platforms/javascript/common/sourcemaps/uploading/rollup.mdx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,18 @@ export default {
6969
org: "___ORG_SLUG___",
7070
project: "___PROJECT_SLUG___",
7171
authToken: process.env.SENTRY_AUTH_TOKEN,
72+
sourcemaps: {
73+
// As you're enabling client source maps, you probably want to delete them after they're uploaded to Sentry.
74+
// Set the appropriate glob pattern for your output folder - some glob examples below:
75+
filesToDeleteAfterUpload: ["./**/*.map", ".*/**/public/**/*.map", "./dist/**/client/**/*.map"]
76+
}
7277
}),
7378
],
7479
};
7580
```
7681

77-
<Alert>
78-
Generating sourcemaps may expose them to the public, potentially causing your
82+
<Alert level="warning">
83+
Generating source maps **may expose them to the public**, potentially causing your
7984
source code to be leaked. You can prevent this by configuring your server to
8085
deny access to `.js.map` files, or by using [Sentry Rollup Plugin's
8186
`sourcemaps.filesToDeleteAfterUpload`](https://www.npmjs.com/package/@sentry/rollup-plugin#sourcemapsfilestodeleteafterupload)

docs/platforms/javascript/common/sourcemaps/uploading/systemjs.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ builder.bundle("src/app.js", "dist/app.min.js", {
2424
});
2525
```
2626

27-
<Alert>
28-
Generating sourcemaps may expose them to the public, potentially causing your source code to be leaked. You can prevent this by configuring your server to deny access to `.js.map` files, or by deleting the sourcemaps before deploying your application.
27+
<Alert level="warning">
28+
Generating source maps **may expose them to the public**, potentially causing your source code to be leaked. You can prevent this by configuring your server to deny access to `.js.map` files, or by deleting the sourcemaps before deploying your application.
2929
</Alert>
3030

3131
<Include name="sentry-cli-sourcemaps.mdx" />

docs/platforms/javascript/common/sourcemaps/uploading/typescript.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ First, configure the TypeScript compiler to output source maps:
4444
}
4545
```
4646

47-
<Alert>
48-
Generating sourcemaps may expose them to the public, potentially causing your source code to be leaked. You can prevent this by configuring your server to deny access to `.js.map` files, or by deleting the sourcemaps before deploying your application.
47+
<Alert level="warning">
48+
Generating source maps **may expose them to the public**, potentially causing your source code to be leaked. You can prevent this by configuring your server to deny access to `.js.map` files, or by deleting the sourcemaps before deploying your application.
4949
</Alert>
5050

5151
<Include name="sentry-cli-sourcemaps.mdx" />

docs/platforms/javascript/common/sourcemaps/uploading/uglifyjs.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ uglifyjs app.js \
2121
--source-map url=app.min.js.map,includeSources
2222
```
2323

24-
<Alert>
25-
Generating sourcemaps may expose them to the public, potentially causing your source code to be leaked. You can prevent this by configuring your server to deny access to `.js.map` files, or by deleting the sourcemaps before deploying your application.
24+
<Alert level="warning">
25+
Generating source maps **may expose them to the public**, potentially causing your source code to be leaked. You can prevent this by configuring your server to deny access to `.js.map` files, or by deleting the sourcemaps before deploying your application.
2626
</Alert>
2727

2828
<Include name="sentry-cli-sourcemaps.mdx" />

docs/platforms/javascript/common/sourcemaps/uploading/vite.mdx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,19 @@ export default defineConfig({
7070
org: "___ORG_SLUG___",
7171
project: "___PROJECT_SLUG___",
7272
authToken: process.env.SENTRY_AUTH_TOKEN,
73+
74+
sourcemaps: {
75+
// As you're enabling client source maps, you probably want to delete them after they're uploaded to Sentry.
76+
// Set the appropriate glob pattern for your output folder - some glob examples below:
77+
filesToDeleteAfterUpload: ["./**/*.map", ".*/**/public/**/*.map", "./dist/**/client/**/*.map"]
78+
}
7379
}),
7480
],
7581
});
7682
```
7783

78-
<Alert>
79-
Generating sourcemaps may expose them to the public, potentially causing your
84+
<Alert level="warning">
85+
Generating source maps **may expose them to the public**, potentially causing your
8086
source code to be leaked. You can prevent this by configuring your server to
8187
deny access to `.js.map` files, or by using [Sentry Vite Plugin's
8288
`sourcemaps.filesToDeleteAfterUpload`](https://www.npmjs.com/package/@sentry/vite-plugin#sourcemapsfilestodeleteafterupload)

docs/platforms/javascript/common/sourcemaps/uploading/webpack.mdx

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ module.exports = {
6969
org: "___ORG_SLUG___",
7070
project: "___PROJECT_SLUG___",
7171
authToken: process.env.SENTRY_AUTH_TOKEN,
72+
73+
sourcemaps: {
74+
// As you're enabling client source maps, you probably want to delete them after they're uploaded to Sentry.
75+
// Set the appropriate glob pattern for your output folder - some glob examples below:
76+
filesToDeleteAfterUpload: ["./**/*.map", ".*/**/public/**/*.map", "./dist/**/client/**/*.map"]
77+
}
7278
}),
7379
],
7480
};
@@ -90,6 +96,12 @@ exports.onCreateWebpackConfig = ({ actions }) => {
9096
org: "___ORG_SLUG___",
9197
project: "___PROJECT_SLUG___",
9298
authToken: process.env.SENTRY_AUTH_TOKEN,
99+
100+
sourcemaps: {
101+
// As you're enabling client source maps, you probably want to delete them after they're uploaded to Sentry.
102+
// Set the appropriate glob pattern for your output folder - some glob examples below:
103+
filesToDeleteAfterUpload: ["./**/*.map", ".*/**/public/**/*.map", "./dist/**/client/**/*.map"]
104+
}
93105
}),
94106
],
95107
});
@@ -98,8 +110,8 @@ exports.onCreateWebpackConfig = ({ actions }) => {
98110

99111
</PlatformSection>
100112

101-
<Alert>
102-
Generating sourcemaps may expose them to the public, potentially causing your
113+
<Alert level="warning">
114+
Generating source maps **may expose them to the public**, potentially causing your
103115
source code to be leaked. You can prevent this by configuring your server to
104116
deny access to `.js.map` files, or by using [Sentry Webpack Plugin's
105117
`sourcemaps.filesToDeleteAfterUpload`](https://www.npmjs.com/package/@sentry/webpack-plugin#sourcemapsfilestodeleteafterupload)

docs/platforms/javascript/guides/sveltekit/manual-setup__v8.x.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ export default {
147147
sourcemaps: {
148148
assets: ["./build/*/**/*"],
149149
ignore: ["**/build/client/**/*"],
150-
filesToDeleteAfterUpload: ["./build/**/*.map"],
150+
filesToDeleteAfterUpload: ["./**/*.map", "./build/**/*.map"],
151151
},
152152
},
153153
}),

0 commit comments

Comments
 (0)