Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(v8/nuxt): Add url to SourcemapsUploadOptions #15202

Merged
merged 1 commit into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading