From 4e474ca6148b44ef1897fd3089090d6e172bdf25 Mon Sep 17 00:00:00 2001 From: Andrey Date: Mon, 11 Sep 2023 17:17:13 +0300 Subject: [PATCH] fix(nextjs): add selfhosted url in next.config.js --- src/nextjs/nextjs-wizard.ts | 2 ++ src/nextjs/templates.ts | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/nextjs/nextjs-wizard.ts b/src/nextjs/nextjs-wizard.ts index bb2e7c32..61b62aef 100644 --- a/src/nextjs/nextjs-wizard.ts +++ b/src/nextjs/nextjs-wizard.ts @@ -118,6 +118,8 @@ export async function runNextjsWizard(options: WizardOptions): Promise { const sentryWebpackOptionsTemplate = getNextjsWebpackPluginOptionsTemplate( selectedProject.organization.slug, selectedProject.slug, + selfHosted, + sentryUrl, ); const sentryBuildOptionsTemplate = getNextjsSentryBuildOptionsTemplate(); diff --git a/src/nextjs/templates.ts b/src/nextjs/templates.ts index 719bca5b..5327cbf2 100644 --- a/src/nextjs/templates.ts +++ b/src/nextjs/templates.ts @@ -1,6 +1,8 @@ export function getNextjsWebpackPluginOptionsTemplate( orgSlug: string, projectSlug: string, + selfHosted: boolean, + url: string, ): string { return `{ // For all available options, see: @@ -8,7 +10,7 @@ export function getNextjsWebpackPluginOptionsTemplate( // Suppresses source map uploading logs during build silent: true, - +${selfHosted ? ` url: "${url}"` : ''} org: "${orgSlug}", project: "${projectSlug}", }`;