Skip to content

Commit 145e236

Browse files
author
Luca Forstner
authored
Update bundler plugin snippets to use new Debug ID process by default (#6653)
1 parent 0eef843 commit 145e236

File tree

5 files changed

+46
-76
lines changed

5 files changed

+46
-76
lines changed

src/platform-includes/sourcemaps/overview/javascript.svelte.mdx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
## Upload Source Maps for a Svelte Project
22

3-
Sentry uses [releases](/product/releases/) to match the correct source maps to your events.
43
This page is a guide on how to create releases and upload source maps to Sentry when bundling your Svelte app.
54

65
To generate source maps with your Svelte project, you need to set the source map [compiler options](https://svelte.dev/docs#compile-time-svelte-compile) in your Svelte config:
@@ -49,13 +48,18 @@ export default defineConfig({
4948
org: "___ORG_SLUG___",
5049
project: "___PROJECT_SLUG___",
5150

52-
// Specify the directory containing build artifacts
53-
include: "./dist",
54-
5551
// Auth tokens can be obtained from https://sentry.io/settings/account/api/auth-tokens/
5652
// and need `project:releases` and `org:read` scopes
5753
authToken: process.env.SENTRY_AUTH_TOKEN,
5854

55+
sourcemaps: {
56+
// Specify the directory containing build artifacts
57+
assets: "./dist/**",
58+
},
59+
60+
// Use the following option if you're on an SDK version lower than 7.47.0:
61+
// include: "./dist",
62+
5963
// Optionally uncomment the line below to override automatic release name detection
6064
// release: process.env.RELEASE,
6165
}),

src/platform-includes/sourcemaps/overview/javascript.vue.mdx

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,18 @@ export default defineConfig({
3838
org: "___ORG_SLUG___",
3939
project: "___PROJECT_SLUG___",
4040

41-
// Specify the directory containing build artifacts
42-
include: "./dist",
43-
4441
// Auth tokens can be obtained from https://sentry.io/settings/account/api/auth-tokens/
45-
// and needs the `project:releases` and `org:read` scopes
42+
// and need `project:releases` and `org:read` scopes
4643
authToken: process.env.SENTRY_AUTH_TOKEN,
4744

45+
sourcemaps: {
46+
// Specify the directory containing build artifacts
47+
assets: "./dist/**",
48+
},
49+
50+
// Use the following option if you're on an SDK version lower than 7.47.0:
51+
// include: "./dist",
52+
4853
// Optionally uncomment the line below to override automatic release name detection
4954
// release: process.env.RELEASE,
5055
}),
@@ -57,19 +62,6 @@ export default defineConfig({
5762
});
5863
```
5964
60-
The Sentry Vite plugin will automatically inject a release value into the SDK so you must either omit the `release` option from `Sentry.init` or make sure `Sentry.init`'s `release` option matches the plugin's `release` option exactly:
61-
62-
```javascript
63-
Sentry.init({
64-
dsn: "___PUBLIC_DSN___",
65-
66-
// When using the plugin, either remove the `release`` property here entirely or
67-
// make sure that the plugin's release option and the Sentry.init()'s release
68-
// option match exactly.
69-
// release: "my-example-release-1"
70-
});
71-
```
72-
7365
## Other Bundlers
7466
7567
In case you are using a bundler other than Vite to build your Vue project, we've compiled a list of guides on how to upload source maps to Sentry for the most popular JavaScript bundlers:

src/platform-includes/sourcemaps/upload/esbuild/javascript.mdx

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Sentry uses [releases](/product/releases/) to match the correct source maps to your events. You can use the Sentry esbuild plugin to automatically create releases and upload source maps to Sentry when bundling your app.
1+
You can use the Sentry esbuild plugin to automatically create releases and upload source maps to Sentry when bundling your app.
22

33
## Install
44

@@ -30,29 +30,21 @@ require("esbuild").build({
3030
org: "___ORG_SLUG___",
3131
project: "___PROJECT_SLUG___",
3232

33-
// Specify the directory containing build artifacts
34-
include: "./dist",
35-
3633
// Auth tokens can be obtained from https://sentry.io/settings/account/api/auth-tokens/
3734
// and need `project:releases` and `org:read` scopes
3835
authToken: process.env.SENTRY_AUTH_TOKEN,
3936

37+
sourcemaps: {
38+
// Specify the directory containing build artifacts
39+
assets: "./dist/**",
40+
},
41+
42+
// Use the following option if you're on an SDK version lower than 7.47.0:
43+
// include: "./dist",
44+
4045
// Optionally uncomment the line below to override automatic release name detection
4146
// release: process.env.RELEASE,
4247
}),
4348
],
4449
});
4550
```
46-
47-
The Sentry esbuild plugin will automatically inject a release value into the SDK so you must either omit the `release` option from `Sentry.init` or make sure `Sentry.init`'s `release` option matches the plugin's `release` option exactly:
48-
49-
```javascript
50-
Sentry.init({
51-
dsn: "___PUBLIC_DSN___",
52-
53-
// When using the plugin, either remove the `release`` property here entirely or
54-
// make sure that the plugin's release option and the Sentry.init()'s release
55-
// option match exactly.
56-
// release: "my-example-release-1"
57-
});
58-
```

src/platform-includes/sourcemaps/upload/rollup/javascript.mdx

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
Sentry uses [releases](/product/releases/) to match the correct source maps to your events.
21
You can use the Sentry Rollup plugin to automatically create releases and upload source maps to Sentry when bundling your app.
32

43
## Installation
@@ -28,13 +27,18 @@ export default {
2827
org: "___ORG_SLUG___",
2928
project: "___PROJECT_SLUG___",
3029

31-
// Specify the directory containing build artifacts
32-
include: "./out",
33-
3430
// Auth tokens can be obtained from https://sentry.io/settings/account/api/auth-tokens/
3531
// and need `project:releases` and `org:read` scopes
3632
authToken: process.env.SENTRY_AUTH_TOKEN,
3733

34+
sourcemaps: {
35+
// Specify the directory containing build artifacts
36+
assets: "./out/**",
37+
},
38+
39+
// Use the following option if you're on an SDK version lower than 7.47.0:
40+
// include: "./out",
41+
3842
// Optionally uncomment the line below to override automatic release name detection
3943
// release: process.env.RELEASE,
4044
}),
@@ -45,16 +49,3 @@ export default {
4549
},
4650
};
4751
```
48-
49-
The Sentry Rollup plugin will automatically inject a release value into the SDK so you must either omit the `release` option from `Sentry.init` or make sure `Sentry.init`'s `release` option matches the plugin's `release` option exactly:
50-
51-
```javascript
52-
Sentry.init({
53-
dsn: "___PUBLIC_DSN___",
54-
55-
// When using the plugin, either remove the `release`` property here entirely or
56-
// make sure that the plugin's release option and the Sentry.init()'s release
57-
// option match exactly.
58-
// release: "my-example-release-1"
59-
});
60-
```
Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Sentry uses [releases](/product/releases/) to match the correct source maps to your events. You can use the Sentry Vite plugin to automatically create releases and upload source maps to Sentry when bundling your app.
1+
You can use the Sentry Vite plugin to automatically create releases and upload source maps to Sentry when bundling your app.
22

33
## Installation
44

@@ -23,8 +23,7 @@ import { sentryVitePlugin } from "@sentry/vite-plugin";
2323
export default defineConfig(({ command, mode }) => {
2424
// Load env file based on `mode` in the current working directory.
2525
// Set the third parameter to '' to load all env regardless of the `VITE_` prefix.
26-
const env = loadEnv(mode, process.cwd(), '')
27-
26+
const env = loadEnv(mode, process.cwd(), "");
2827
return {
2928
build: {
3029
sourcemap: true, // Source map generation must be turned on
@@ -35,30 +34,22 @@ export default defineConfig(({ command, mode }) => {
3534
org: "___ORG_SLUG___",
3635
project: "___PROJECT_SLUG___",
3736

38-
// Specify the directory containing build artifacts
39-
include: "./dist",
40-
4137
// Auth tokens can be obtained from https://sentry.io/settings/account/api/auth-tokens/
42-
// and needs the `project:releases` and `org:read` scopes
38+
// and need `project:releases` and `org:read` scopes
4339
authToken: env.SENTRY_AUTH_TOKEN,
4440

41+
sourcemaps: {
42+
// Specify the directory containing build artifacts
43+
assets: "./dist/**",
44+
},
45+
46+
// Use the following option if you're on an SDK version lower than 7.47.0:
47+
// include: "./dist",
48+
4549
// Optionally uncomment the line below to override automatic release name detection
4650
// release: env.RELEASE,
4751
}),
4852
],
49-
}
50-
});
51-
```
52-
53-
The Sentry Vite plugin will automatically inject a release value into the SDK so you must either omit the `release` option from `Sentry.init` or make sure `Sentry.init`'s `release` option matches the plugin's `release` option exactly:
54-
55-
```javascript
56-
Sentry.init({
57-
dsn: "___PUBLIC_DSN___",
58-
59-
// When using the plugin, either remove the `release`` property here entirely or
60-
// make sure that the plugin's release option and the Sentry.init()'s release
61-
// option match exactly.
62-
// release: "my-example-release-1"
53+
};
6354
});
6455
```

0 commit comments

Comments
 (0)