Skip to content

Commit

Permalink
feat(v8/nuxt): Add url to SourcemapsUploadOptions (#15202)
Browse files Browse the repository at this point in the history
backport of #15171

Co-authored-by: chris-basebone <[email protected]>
  • Loading branch information
Lms24 and chris-basebone authored Jan 31, 2025
1 parent 36bdc47 commit 4df3759
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/nuxt/src/common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ type SourceMapsOptions = {
*/
org?: string;

/**
* The URL of your Sentry instance if you're using self-hosted Sentry.
*
* @default https://sentry.io by default the plugin will point towards the Sentry SaaS URL
*/
url?: string;

/**
* The project slug of your Sentry project.
* Instead of specifying this option, you can also set the `SENTRY_PROJECT` environment variable.
Expand Down
1 change: 1 addition & 0 deletions packages/nuxt/src/vite/sourceMaps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ export function getPluginOptions(
project: sourceMapsUploadOptions.project ?? process.env.SENTRY_PROJECT,
authToken: sourceMapsUploadOptions.authToken ?? process.env.SENTRY_AUTH_TOKEN,
telemetry: sourceMapsUploadOptions.telemetry ?? true,
url: sourceMapsUploadOptions.url ?? process.env.SENTRY_URL,
debug: moduleOptions.debug ?? false,
_metaOptions: {
telemetry: {
Expand Down
5 changes: 5 additions & 0 deletions packages/nuxt/test/vite/sourceMaps.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ describe('getPluginOptions', () => {
SENTRY_ORG: 'default-org',
SENTRY_PROJECT: 'default-project',
SENTRY_AUTH_TOKEN: 'default-token',
SENTRY_URL: 'https://santry.io',
};

process.env = { ...defaultEnv };
Expand All @@ -31,6 +32,7 @@ describe('getPluginOptions', () => {
org: 'default-org',
project: 'default-project',
authToken: 'default-token',
url: 'https://santry.io',
telemetry: true,
sourcemaps: expect.objectContaining({
rewriteSources: expect.any(Function),
Expand Down Expand Up @@ -114,6 +116,7 @@ describe('getPluginOptions', () => {
assets: ['custom-assets/**/*'],
filesToDeleteAfterUpload: ['delete-this.js'],
},
url: 'https://santry.io',
},
debug: true,
unstable_sentryBundlerPluginOptions: {
Expand All @@ -124,6 +127,7 @@ describe('getPluginOptions', () => {
release: {
name: 'test-release',
},
url: 'https://suntry.io',
},
};
const options = getPluginOptions(customOptions, false);
Expand All @@ -140,6 +144,7 @@ describe('getPluginOptions', () => {
release: expect.objectContaining({
name: 'test-release',
}),
url: 'https://suntry.io',
}),
);
});
Expand Down

0 comments on commit 4df3759

Please sign in to comment.