Skip to content

Commit a34e6c5

Browse files
Lms24shanamatthews
andauthored
feat(astro): Document assets sourcemaps upload option (#8586)
adds documentation for the new assets option soon to be released in the Astro SDK. Functionality it's 1:1 on par with the Vite plugin assets option but we don't expose the full Vite Plugin API in the Astro SDK; hence the dedicated documentation --------- Co-authored-by: Shana Matthews <[email protected]>
1 parent 3f1bbc8 commit a34e6c5

File tree

1 file changed

+27
-8
lines changed

1 file changed

+27
-8
lines changed

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

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,36 +28,55 @@ export default defineConfig({
2828
});
2929
```
3030

31-
### Working With Old Authentication Tokens
31+
### Disable Source Maps Upload
3232

33-
Source maps work best with [organization-scoped auth tokens](/product/accounts/auth-tokens/#organization-auth-tokens). If you are using an old self-hosted Sentry version that doesn't yet support org-based tokens or you're using a different type of Sentry auth token, you'll need to additionally specify your `org` slug in your `sourceMapsUploadOptions`:
33+
You can disable automatic source maps upload in your Astro config:
3434

3535
```javascript {filename:astro.config.mjs}
3636
export default defineConfig({
3737
integrations: [
3838
sentry({
3939
// Other Sentry options
4040
sourceMapsUploadOptions: {
41-
project: "___PROJECT_SLUG___",
42-
org: "___ORG_SLUG___",
43-
authToken: process.env.SENTRY_AUTH_TOKEN,
41+
enabled: false,
4442
},
4543
}),
4644
],
4745
});
4846
```
4947

50-
### Disable Source Maps Upload
48+
### Setting the Source Maps Assets Directory
5149

52-
You can disable automatic source maps upload in your Astro config:
50+
By default, the Sentry Astro integration will look for source maps in sensible default directories, depending on your `outDir`, `rootDir` and `adapter` configuration.
51+
If these defaults don't work for you (for example, due to an advanced customized build setup or an unsupported adapter), you can specify the `assets` option to point to the folder(s) where your source maps are located:
52+
53+
```javascript {filename:astro.config.mjs}
54+
export default defineConfig({
55+
integrations: [
56+
sentry({
57+
sourceMapsUploadOptions: {
58+
assets: [".clientOut/**/*", ".serverOut/**/*"],
59+
},
60+
}),
61+
],
62+
});
63+
```
64+
65+
The specified patterns must follow the [glob syntax](https://www.npmjs.com/package/glob#glob-primer).
66+
67+
### Working With Old Authentication Tokens
68+
69+
Source maps work best with [organization-scoped auth tokens](/product/accounts/auth-tokens/#organization-auth-tokens). If you are using an old self-hosted Sentry version that doesn't yet support org-based tokens or you're using a different type of Sentry auth token, you'll need to additionally specify your `org` slug in your `sourceMapsUploadOptions`:
5370

5471
```javascript {filename:astro.config.mjs}
5572
export default defineConfig({
5673
integrations: [
5774
sentry({
5875
// Other Sentry options
5976
sourceMapsUploadOptions: {
60-
enabled: false,
77+
project: "___PROJECT_SLUG___",
78+
org: "___ORG_SLUG___",
79+
authToken: process.env.SENTRY_AUTH_TOKEN,
6180
},
6281
}),
6382
],

0 commit comments

Comments
 (0)