Skip to content

Commit 6cf7983

Browse files
author
Luca Forstner
authored
Clean up bundler plugin instructions (#7048)
1 parent b2578de commit 6cf7983

File tree

7 files changed

+55
-142
lines changed

7 files changed

+55
-142
lines changed

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

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

3+
<Note>
4+
5+
This guide assumes you are using the `@sentry/svelte` SDK on version `7.47.0` or higher.
6+
7+
If you are on an older version and you want to upload source maps we recommend upgrading your SDK to the newest version.
8+
9+
</Note>
10+
311
This page is a guide on how to create releases and upload source maps to Sentry when bundling your Svelte app.
412

513
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:
@@ -51,17 +59,6 @@ export default defineConfig({
5159
// Auth tokens can be obtained from https://sentry.io/settings/account/api/auth-tokens/
5260
// and need `project:releases` and `org:read` scopes
5361
authToken: process.env.SENTRY_AUTH_TOKEN,
54-
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-
63-
// Optionally uncomment the line below to override automatic release name detection
64-
// release: process.env.RELEASE,
6562
}),
6663
],
6764
});

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

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
## Uploading Source Maps using Vite
22

3+
<Note>
4+
5+
This guide assumes you are using the `@sentry/vue` SDK on version `7.47.0` or higher.
6+
7+
If you are on an older version and you want to upload source maps we recommend upgrading your SDK to the newest version.
8+
9+
</Note>
10+
311
If you are using Vue, chances are good you are using Vite to bundle your project.
412
You can use the Sentry Vite plugin to automatically create [releases](/product/releases/) and upload source maps to Sentry when bundling your app.
513

@@ -40,27 +48,6 @@ export default defineConfig({
4048
// Auth tokens can be obtained from https://sentry.io/settings/account/api/auth-tokens/
4149
// and need `project:releases` and `org:read` scopes
4250
authToken: env.SENTRY_AUTH_TOKEN,
43-
44-
sourcemaps: {
45-
// Specify the directory containing build artifacts
46-
assets: "./**",
47-
// Don't upload the source maps of dependencies
48-
ignore: ["./node_modules/**"],
49-
},
50-
51-
// Helps troubleshooting - set to false to make plugin less noisy
52-
debug: true,
53-
54-
// Use the following option if you're on an SDK version lower than 7.47.0:
55-
// release: {
56-
// uploadLegacySourcemaps: {
57-
// include: ".",
58-
// ignore: ["node_modules"],
59-
// },
60-
// },
61-
62-
// Optionally uncomment the line below to override automatic release name detection
63-
// release: process.env.RELEASE,
6451
}),
6552
],
6653
});

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

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
<Note>
2+
3+
This guide assumes you are using a Sentry SDK on version `7.47.0` or higher.
4+
5+
If you are on an older version and you want to upload source maps we recommend upgrading your SDK to the newest version.
6+
7+
</Note>
8+
19
You can use the Sentry esbuild plugin to automatically create releases and upload source maps to Sentry when bundling your app.
210

311
## Install
@@ -30,27 +38,6 @@ require("esbuild").build({
3038
// Auth tokens can be obtained from https://sentry.io/settings/account/api/auth-tokens/
3139
// and need `project:releases` and `org:read` scopes
3240
authToken: env.SENTRY_AUTH_TOKEN,
33-
34-
sourcemaps: {
35-
// Specify the directory containing build artifacts
36-
assets: "./**",
37-
// Don't upload the source maps of dependencies
38-
ignore: ["./node_modules/**"],
39-
},
40-
41-
// Helps troubleshooting - set to false to make plugin less noisy
42-
debug: true,
43-
44-
// Use the following option if you're on an SDK version lower than 7.47.0:
45-
// release: {
46-
// uploadLegacySourcemaps: {
47-
// include: ".",
48-
// ignore: ["node_modules"],
49-
// },
50-
// },
51-
52-
// Optionally uncomment the line below to override automatic release name detection
53-
// release: process.env.RELEASE,
5441
}),
5542
],
5643
});

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

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
<Note>
2+
3+
This guide assumes you are using a Sentry SDK on version `7.47.0` or higher.
4+
5+
If you are on an older version and you want to upload source maps we recommend upgrading your SDK to the newest version.
6+
7+
</Note>
8+
19
You can use the Sentry Rollup plugin to automatically create releases and upload source maps to Sentry when bundling your app.
210

311
## Installation
@@ -29,27 +37,6 @@ export default {
2937
// Auth tokens can be obtained from https://sentry.io/settings/account/api/auth-tokens/
3038
// and need `project:releases` and `org:read` scopes
3139
authToken: env.SENTRY_AUTH_TOKEN,
32-
33-
sourcemaps: {
34-
// Specify the directory containing build artifacts
35-
assets: "./**",
36-
// Don't upload the source maps of dependencies
37-
ignore: ["./node_modules/**"],
38-
},
39-
40-
// Helps troubleshooting - set to false to make plugin less noisy
41-
debug: true,
42-
43-
// Use the following option if you're on an SDK version lower than 7.47.0:
44-
// release: {
45-
// uploadLegacySourcemaps: {
46-
// include: ".",
47-
// ignore: ["node_modules"],
48-
// },
49-
// },
50-
51-
// Optionally uncomment the line below to override automatic release name detection
52-
// release: process.env.RELEASE,
5340
}),
5441
],
5542
output: {

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

Lines changed: 10 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
<Note>
2+
3+
This guide assumes you are using a Sentry SDK on version `7.47.0` or higher.
4+
5+
If you are on an older version and you want to upload source maps we recommend upgrading your SDK to the newest version.
6+
7+
</Note>
8+
19
You can use the Sentry Vite plugin to automatically create releases and upload source maps to Sentry when bundling your app.
210

311
## Installation
@@ -17,13 +25,10 @@ Learn more about configuring the plugin in our [Sentry Vite Plugin documentation
1725
Example:
1826

1927
```javascript {filename:vite.config.js}
20-
import { defineConfig, loadEnv } from "vite";
28+
import { defineConfig } from "vite";
2129
import { sentryVitePlugin } from "@sentry/vite-plugin";
2230

23-
export default defineConfig(({ command, mode }) => {
24-
// Load env file based on `mode` in the current working directory.
25-
// Set the third parameter to '' to load all env regardless of the `VITE_` prefix.
26-
const env = loadEnv(mode, process.cwd(), "");
31+
export default defineConfig({
2732
return {
2833
build: {
2934
sourcemap: true, // Source map generation must be turned on
@@ -37,27 +42,6 @@ export default defineConfig(({ command, mode }) => {
3742
// Auth tokens can be obtained from https://sentry.io/settings/account/api/auth-tokens/
3843
// and need `project:releases` and `org:read` scopes
3944
authToken: env.SENTRY_AUTH_TOKEN,
40-
41-
sourcemaps: {
42-
// Specify the directory containing build artifacts
43-
assets: "./**",
44-
// Don't upload the source maps of dependencies
45-
ignore: ["./node_modules/**"],
46-
},
47-
48-
// Helps troubleshooting - set to false to make plugin less noisy
49-
debug: true,
50-
51-
// Use the following option if you're on an SDK version lower than 7.47.0:
52-
// release: {
53-
// uploadLegacySourcemaps: {
54-
// include: ".",
55-
// ignore: ["node_modules"],
56-
// },
57-
// },
58-
59-
// Optionally uncomment the line below to override automatic release name detection
60-
// release: env.RELEASE,
6145
}),
6246
],
6347
};

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

Lines changed: 5 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
You can use the Sentry Webpack plugin to automatically create releases and upload source maps to Sentry when bundling your app.
2-
31
<Note>
42

5-
This guide for the Sentry Webpack plugin is for version `2.x` of the plugin.
6-
If you are using version `1.x` of `@sentry/webpack-plugin` please see the migration guide on how to update:
7-
https://github.com/getsentry/sentry-javascript-bundler-plugins/blob/main/MIGRATION.md
3+
This guide assumes you are using a Sentry SDK on version `7.47.0` or higher.
4+
5+
If you are on an older version and you want to upload source maps we recommend upgrading your SDK to the newest version.
86

97
</Note>
108

9+
You can use the Sentry Webpack plugin to automatically create releases and upload source maps to Sentry when bundling your app.
10+
1111
## Installation
1212

1313
```bash {tabTitle:npm}
@@ -41,27 +41,6 @@ module.exports = {
4141
// Auth tokens can be obtained from https://sentry.io/settings/account/api/auth-tokens/
4242
// and need `project:releases` and `org:read` scopes
4343
authToken: process.env.SENTRY_AUTH_TOKEN,
44-
45-
sourcemaps: {
46-
// Specify the directory containing build artifacts
47-
assets: "./**",
48-
// Don't upload the source maps of dependencies
49-
ignore: ["./node_modules/**"],
50-
},
51-
52-
// Helps troubleshooting - set to false to make plugin less noisy
53-
debug: true,
54-
55-
// Use the following option if you're on an SDK version lower than 7.47.0:
56-
// release: {
57-
// uploadLegacySourcemaps: {
58-
// include: ".",
59-
// ignore: ["node_modules"],
60-
// },
61-
// },
62-
63-
// Optionally uncomment the line below to override automatic release name detection
64-
// release: process.env.RELEASE,
6544
}),
6645
],
6746
};
@@ -84,22 +63,6 @@ exports.onCreateWebpackConfig = ({ actions }) => {
8463
// Auth tokens can be obtained from https://sentry.io/settings/account/api/auth-tokens/
8564
// and need `project:releases` and `org:read` scopes
8665
authToken: process.env.SENTRY_AUTH_TOKEN,
87-
88-
sourcemaps: {
89-
// Specify the directory containing build artifacts
90-
assets: "./**",
91-
// Don't upload the source maps of dependencies
92-
ignore: ["./node_modules/**"],
93-
},
94-
95-
// Helps troubleshooting - set to false to make plugin less noisy
96-
debug: true,
97-
98-
// Use the following option if you're on an SDK version lower than 7.47.0:
99-
// include: "./dist",
100-
101-
// Optionally uncomment the line below to override automatic release name detection
102-
// release: process.env.RELEASE,
10366
}),
10467
],
10568
});

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,14 @@ If you're using an Angular version below 13, only `ng build --prod` will leverag
6969

7070
### 2. Register the Sentry Webpack Plugin
7171

72+
<Note>
73+
74+
This guide assumes you are using a Sentry SDK on version `7.47.0` or higher.
75+
76+
If you are on an older version and you want to upload source maps we recommend upgrading your SDK to the newest version.
77+
78+
</Note>
79+
7280
Register the Sentry Webpack plugin in your `webpack.config.js`:
7381

7482
```javascript {filename:webpack.config.js}

0 commit comments

Comments
 (0)