diff --git a/CHANGELOG.md b/CHANGELOG.md index d570a4a4..6caa9324 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Unreleased - enh(android): Show link to issues page after setup is complete (#448) +- fix(nextjs): Add selfhosted url in `next.config.js` (#438) - fix(nextjs): Create necessary directories in app router (#439) Work in this release contributed by @andreysam. Thank you for your contributions! diff --git a/src/nextjs/nextjs-wizard.ts b/src/nextjs/nextjs-wizard.ts index 44680f2e..734fdce5 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..1ea754ab 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,9 +10,8 @@ export function getNextjsWebpackPluginOptionsTemplate( // Suppresses source map uploading logs during build silent: true, - org: "${orgSlug}", - project: "${projectSlug}", + project: "${projectSlug}",${selfHosted ? `\n url: "${url}"` : ''} }`; }