Skip to content

Commit 4df3759

Browse files
feat(v8/nuxt): Add url to SourcemapsUploadOptions (#15202)
backport of #15171 Co-authored-by: chris-basebone <[email protected]>
1 parent 36bdc47 commit 4df3759

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

packages/nuxt/src/common/types.ts

+7
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@ type SourceMapsOptions = {
3232
*/
3333
org?: string;
3434

35+
/**
36+
* The URL of your Sentry instance if you're using self-hosted Sentry.
37+
*
38+
* @default https://sentry.io by default the plugin will point towards the Sentry SaaS URL
39+
*/
40+
url?: string;
41+
3542
/**
3643
* The project slug of your Sentry project.
3744
* Instead of specifying this option, you can also set the `SENTRY_PROJECT` environment variable.

packages/nuxt/src/vite/sourceMaps.ts

+1
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ export function getPluginOptions(
9191
project: sourceMapsUploadOptions.project ?? process.env.SENTRY_PROJECT,
9292
authToken: sourceMapsUploadOptions.authToken ?? process.env.SENTRY_AUTH_TOKEN,
9393
telemetry: sourceMapsUploadOptions.telemetry ?? true,
94+
url: sourceMapsUploadOptions.url ?? process.env.SENTRY_URL,
9495
debug: moduleOptions.debug ?? false,
9596
_metaOptions: {
9697
telemetry: {

packages/nuxt/test/vite/sourceMaps.test.ts

+5
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ describe('getPluginOptions', () => {
2020
SENTRY_ORG: 'default-org',
2121
SENTRY_PROJECT: 'default-project',
2222
SENTRY_AUTH_TOKEN: 'default-token',
23+
SENTRY_URL: 'https://santry.io',
2324
};
2425

2526
process.env = { ...defaultEnv };
@@ -31,6 +32,7 @@ describe('getPluginOptions', () => {
3132
org: 'default-org',
3233
project: 'default-project',
3334
authToken: 'default-token',
35+
url: 'https://santry.io',
3436
telemetry: true,
3537
sourcemaps: expect.objectContaining({
3638
rewriteSources: expect.any(Function),
@@ -114,6 +116,7 @@ describe('getPluginOptions', () => {
114116
assets: ['custom-assets/**/*'],
115117
filesToDeleteAfterUpload: ['delete-this.js'],
116118
},
119+
url: 'https://santry.io',
117120
},
118121
debug: true,
119122
unstable_sentryBundlerPluginOptions: {
@@ -124,6 +127,7 @@ describe('getPluginOptions', () => {
124127
release: {
125128
name: 'test-release',
126129
},
130+
url: 'https://suntry.io',
127131
},
128132
};
129133
const options = getPluginOptions(customOptions, false);
@@ -140,6 +144,7 @@ describe('getPluginOptions', () => {
140144
release: expect.objectContaining({
141145
name: 'test-release',
142146
}),
147+
url: 'https://suntry.io',
143148
}),
144149
);
145150
});

0 commit comments

Comments
 (0)