{"version":3,"file":"sourceMaps.js","sources":["../../../src/vite/sourceMaps.ts"],"sourcesContent":["import type { Nuxt } from '@nuxt/schema';\nimport { sentryRollupPlugin, type SentryRollupPluginOptions } from '@sentry/rollup-plugin';\nimport { sentryVitePlugin, type SentryVitePluginOptions } from '@sentry/vite-plugin';\nimport type { NitroConfig } from 'nitropack';\nimport type { Plugin } from 'vite';\nimport type { SentryNuxtModuleOptions } from '../common/types';\nimport { validateSourceMapsOptionsPlugin } from './sentryVitePlugin';\n\n/**\n * Whether the user enabled (true, 'hidden', 'inline') or disabled (false) source maps\n */\nexport type UserSourceMapSetting = 'enabled' | 'disabled' | 'unset' | undefined;\n\n/** A valid source map setting */\nexport type SourceMapSetting = boolean | 'hidden' | 'inline';\n\n/**\n * Setup source maps for Sentry inside the Nuxt module during build time (in Vite for Nuxt and Rollup for Nitro).\n */\nexport function setupSourceMaps(\n moduleOptions: SentryNuxtModuleOptions,\n nuxt: Nuxt,\n addVitePlugin: (plugin: Plugin[], options?: { dev?: boolean; build?: boolean }) => void,\n): void {\n // TODO(v11): remove deprecated options (also from SentryNuxtModuleOptions type)\n\n const isDebug = moduleOptions.debug;\n\n // eslint-disable-next-line deprecation/deprecation\n const sourceMapsUploadOptions = moduleOptions.sourceMapsUploadOptions || {};\n\n const sourceMapsEnabled =\n moduleOptions.sourcemaps?.disable === true\n ? false\n : moduleOptions.sourcemaps?.disable === false\n ? true\n : // eslint-disable-next-line deprecation/deprecation\n (sourceMapsUploadOptions.enabled ?? true);\n\n // In case we overwrite the source map settings, we default to deleting the files\n const shouldDeleteFilesFallback = { client: true, server: true };\n\n nuxt.hook('modules:done', () => {\n if (sourceMapsEnabled && !nuxt.options.dev && !nuxt.options?._prepare) {\n // Changing this setting will propagate:\n // - for client to viteConfig.build.sourceMap\n // - for server to viteConfig.build.sourceMap and nitro.sourceMap\n // On server, nitro.rollupConfig.output.sourcemap remains unaffected from this change.\n\n // ONLY THIS nuxt.sourcemap.(server/client) setting is the one Sentry will overwrite with 'hidden', if needed.\n const previousSourceMapSettings = changeNuxtSourceMapSettings(nuxt, moduleOptions);\n\n // Mutate in place so the Vite plugin (which captured this object at registration time) sees the updated values\n shouldDeleteFilesFallback.client = previousSourceMapSettings.client === 'unset';\n shouldDeleteFilesFallback.server = previousSourceMapSettings.server === 'unset';\n\n if (isDebug && (shouldDeleteFilesFallback.client || shouldDeleteFilesFallback.server)) {\n const enabledDeleteFallbacks =\n shouldDeleteFilesFallback.client && shouldDeleteFilesFallback.server\n ? 'client-side and server-side'\n : shouldDeleteFilesFallback.server\n ? 'server-side'\n : 'client-side';\n\n if (\n !moduleOptions.sourcemaps?.filesToDeleteAfterUpload &&\n // eslint-disable-next-line deprecation/deprecation\n !sourceMapsUploadOptions.sourcemaps?.filesToDeleteAfterUpload\n ) {\n // eslint-disable-next-line no-console\n console.log(\n `[Sentry] We enabled \\`'hidden'\\` source maps for your ${enabledDeleteFallbacks} build. Source map files will be automatically deleted after uploading them to Sentry.`,\n );\n } else {\n // eslint-disable-next-line no-console\n console.log(\n `[Sentry] We enabled \\`'hidden'\\` source maps for your ${enabledDeleteFallbacks} build. Source map files will be deleted according to your \\`sourcemaps.filesToDeleteAfterUpload\\` configuration. To use automatic deletion instead, leave \\`filesToDeleteAfterUpload\\` empty.`,\n );\n }\n }\n }\n });\n\n if (sourceMapsEnabled && !nuxt.options.dev && !nuxt.options?._prepare) {\n addVitePlugin(\n [\n validateSourceMapsOptionsPlugin({ nuxt, moduleOptions, sourceMapsEnabled }),\n // Vite plugin is added on the client and server side (plugin runs for both builds)\n ...sentryVitePlugin(getPluginOptions(moduleOptions, shouldDeleteFilesFallback)),\n ],\n { dev: false, build: true }, // Only add source map plugin during build\n );\n }\n\n nuxt.hook('nitro:config', (nitroConfig: NitroConfig) => {\n if (sourceMapsEnabled && !nitroConfig.dev && !nuxt.options?._prepare) {\n if (!nitroConfig.rollupConfig) {\n nitroConfig.rollupConfig = {};\n }\n\n if (nitroConfig.rollupConfig.plugins === null || nitroConfig.rollupConfig.plugins === undefined) {\n nitroConfig.rollupConfig.plugins = [];\n } else if (!Array.isArray(nitroConfig.rollupConfig.plugins)) {\n // `rollupConfig.plugins` can be a single plugin, so we want to put it into an array so that we can push our own plugin\n nitroConfig.rollupConfig.plugins = [nitroConfig.rollupConfig.plugins];\n }\n\n validateNitroSourceMapSettings(nuxt, nitroConfig, moduleOptions);\n\n if (isDebug) {\n // eslint-disable-next-line no-console\n console.log('[Sentry] Adding Sentry Rollup plugin to the server runtime.');\n }\n\n // Add Sentry plugin\n // Runs only on server-side (Nitro)\n nitroConfig.rollupConfig.plugins.push(\n sentryRollupPlugin(getPluginOptions(moduleOptions, shouldDeleteFilesFallback)),\n );\n }\n });\n}\n\n/**\n * Normalizes the beginning of a path from e.g. ../../../ to ./\n */\nfunction normalizePath(path: string): string {\n return path.replace(/^(\\.\\.\\/)+/, './');\n}\n\n/**\n * Generates source maps upload options for the Sentry Vite and Rollup plugin.\n *\n * Only exported for Testing purposes.\n */\n// todo(v11): This \"eslint-disable\" can be removed again once we remove deprecated options.\n// eslint-disable-next-line complexity\nexport function getPluginOptions(\n moduleOptions: SentryNuxtModuleOptions,\n shouldDeleteFilesFallback?: { client: boolean; server: boolean },\n): SentryVitePluginOptions | SentryRollupPluginOptions {\n // eslint-disable-next-line deprecation/deprecation\n const sourceMapsUploadOptions = moduleOptions.sourceMapsUploadOptions || {};\n\n const shouldDeleteFilesAfterUpload = shouldDeleteFilesFallback?.client || shouldDeleteFilesFallback?.server;\n const fallbackFilesToDelete = [\n ...(shouldDeleteFilesFallback?.client ? ['.*/**/public/**/*.map'] : []),\n ...(shouldDeleteFilesFallback?.server\n ? ['.*/**/server/**/*.map', '.*/**/output/**/*.map', '.*/**/function/**/*.map']\n : []),\n ];\n\n // Check for filesToDeleteAfterUpload in new location first, then deprecated location\n const sourcemapsOptions = moduleOptions.sourcemaps || {};\n // eslint-disable-next-line deprecation/deprecation\n const deprecatedSourcemapsOptions = sourceMapsUploadOptions.sourcemaps || {};\n\n const filesToDeleteAfterUpload =\n sourcemapsOptions.filesToDeleteAfterUpload ??\n // eslint-disable-next-line deprecation/deprecation\n deprecatedSourcemapsOptions.filesToDeleteAfterUpload;\n\n if (typeof filesToDeleteAfterUpload === 'undefined' && shouldDeleteFilesAfterUpload && moduleOptions.debug) {\n // eslint-disable-next-line no-console\n console.log(\n `[Sentry] Setting \\`sentry.sourceMapsUploadOptions.sourcemaps.filesToDeleteAfterUpload: [${fallbackFilesToDelete\n // Logging it as strings in the array\n .map(path => `\"${path}\"`)\n .join(', ')}]\\` to delete generated source maps after they were uploaded to Sentry.`,\n );\n }\n\n return {\n applicationKey: moduleOptions.applicationKey,\n // eslint-disable-next-line deprecation/deprecation\n org: moduleOptions.org ?? sourceMapsUploadOptions.org ?? process.env.SENTRY_ORG,\n // eslint-disable-next-line deprecation/deprecation\n project: moduleOptions.project ?? sourceMapsUploadOptions.project ?? process.env.SENTRY_PROJECT,\n // eslint-disable-next-line deprecation/deprecation\n authToken: moduleOptions.authToken ?? sourceMapsUploadOptions.authToken ?? process.env.SENTRY_AUTH_TOKEN,\n // eslint-disable-next-line deprecation/deprecation\n telemetry: moduleOptions.telemetry ?? sourceMapsUploadOptions.telemetry ?? true,\n // eslint-disable-next-line deprecation/deprecation\n url: moduleOptions.sentryUrl ?? sourceMapsUploadOptions.url ?? process.env.SENTRY_URL,\n headers: moduleOptions.headers,\n debug: moduleOptions.debug ?? false,\n // eslint-disable-next-line deprecation/deprecation\n silent: moduleOptions.silent ?? sourceMapsUploadOptions.silent ?? false,\n // eslint-disable-next-line deprecation/deprecation\n errorHandler: moduleOptions.errorHandler ?? sourceMapsUploadOptions.errorHandler,\n bundleSizeOptimizations: moduleOptions.bundleSizeOptimizations, // todo: test if this can be overridden by the user\n release: {\n // eslint-disable-next-line deprecation/deprecation\n name: moduleOptions.release?.name ?? sourceMapsUploadOptions.release?.name,\n // Support all release options from BuildTimeOptionsBase\n ...moduleOptions.release,\n ...moduleOptions?.unstable_sentryBundlerPluginOptions?.release,\n },\n _metaOptions: {\n telemetry: {\n metaFramework: 'nuxt',\n },\n },\n ...moduleOptions?.unstable_sentryBundlerPluginOptions,\n\n sourcemaps: {\n disable: moduleOptions.sourcemaps?.disable,\n // The server/client files are in different places depending on the nitro preset (e.g. '.output/server' or '.netlify/functions-internal/server')\n // We cannot determine automatically how the build folder looks like (depends on the preset), so we have to accept that source maps are uploaded multiple times (with the vitePlugin for Nuxt and the rollupPlugin for Nitro).\n // If we could know where the server/client assets are located, we could do something like this (based on the Nitro preset): isNitro ? ['./.output/server/**/*'] : ['./.output/public/**/*'],\n // eslint-disable-next-line deprecation/deprecation\n assets: sourcemapsOptions.assets ?? deprecatedSourcemapsOptions.assets ?? undefined,\n // eslint-disable-next-line deprecation/deprecation\n ignore: sourcemapsOptions.ignore ?? deprecatedSourcemapsOptions.ignore ?? undefined,\n filesToDeleteAfterUpload: filesToDeleteAfterUpload\n ? filesToDeleteAfterUpload\n : shouldDeleteFilesFallback?.server || shouldDeleteFilesFallback?.client\n ? fallbackFilesToDelete\n : undefined,\n rewriteSources: sourcemapsOptions.rewriteSources ?? normalizePath,\n ...moduleOptions?.unstable_sentryBundlerPluginOptions?.sourcemaps,\n },\n };\n}\n\n/* There are multiple ways to set up source maps (https://github.com/getsentry/sentry-javascript/issues/13993 and https://github.com/getsentry/sentry-javascript/pull/15859)\n 1. User explicitly disabled source maps\n - keep this setting (emit a warning that errors won't be unminified in Sentry)\n - We will not upload anything\n 2. users enabled source map generation (true, hidden, inline).\n - keep this setting (don't do anything - like deletion - besides uploading)\n 3. users did not set source maps generation\n - we enable 'hidden' source maps generation\n - configure `filesToDeleteAfterUpload` to delete all .map files (we emit a log about this)\n\n Users only have to explicitly enable client source maps. Sentry only overwrites the base Nuxt source map settings as they propagate.\n */\n\n/** only exported for tests */\nexport function extractNuxtSourceMapSetting(\n nuxt: { options: { sourcemap?: SourceMapSetting | { server?: SourceMapSetting; client?: SourceMapSetting } } },\n runtime: 'client' | 'server' | undefined,\n): SourceMapSetting | undefined {\n if (!runtime) {\n return undefined;\n } else {\n return typeof nuxt.options?.sourcemap === 'boolean' || typeof nuxt.options?.sourcemap === 'string'\n ? nuxt.options.sourcemap\n : nuxt.options?.sourcemap?.[runtime];\n }\n}\n\n/** only exported for testing */\nexport function changeNuxtSourceMapSettings(\n nuxt: Nuxt,\n sentryModuleOptions: SentryNuxtModuleOptions,\n): { client: UserSourceMapSetting; server: UserSourceMapSetting } {\n nuxt.options.sourcemap = nuxt.options.sourcemap ?? { server: undefined, client: undefined };\n\n let previousUserSourceMapSetting: { client: UserSourceMapSetting; server: UserSourceMapSetting } = {\n client: undefined,\n server: undefined,\n };\n\n const nuxtSourceMap = nuxt.options.sourcemap;\n const isDebug = sentryModuleOptions.debug;\n\n if (typeof nuxtSourceMap === 'string' || typeof nuxtSourceMap === 'boolean' || typeof nuxtSourceMap === 'undefined') {\n switch (nuxtSourceMap) {\n case false:\n warnExplicitlyDisabledSourceMap('sourcemap', isDebug);\n previousUserSourceMapSetting = { client: 'disabled', server: 'disabled' };\n break;\n\n case 'hidden':\n case true:\n logKeepEnabledSourceMapSetting(sentryModuleOptions, 'sourcemap', (nuxtSourceMap as true).toString());\n previousUserSourceMapSetting = { client: 'enabled', server: 'enabled' };\n break;\n case undefined:\n nuxt.options.sourcemap = { server: 'hidden', client: 'hidden' };\n isDebug && logSentryEnablesSourceMap('sourcemap.client', 'hidden');\n isDebug && logSentryEnablesSourceMap('sourcemap.server', 'hidden');\n previousUserSourceMapSetting = { client: 'unset', server: 'unset' };\n break;\n }\n } else {\n if (nuxtSourceMap.client === false) {\n warnExplicitlyDisabledSourceMap('sourcemap.client', isDebug);\n previousUserSourceMapSetting.client = 'disabled';\n } else if (['hidden', true].includes(nuxtSourceMap.client)) {\n logKeepEnabledSourceMapSetting(sentryModuleOptions, 'sourcemap.client', nuxtSourceMap.client.toString());\n previousUserSourceMapSetting.client = 'enabled';\n } else {\n nuxt.options.sourcemap.client = 'hidden';\n isDebug && logSentryEnablesSourceMap('sourcemap.client', 'hidden');\n previousUserSourceMapSetting.client = 'unset';\n }\n\n if (nuxtSourceMap.server === false) {\n warnExplicitlyDisabledSourceMap('sourcemap.server', isDebug);\n previousUserSourceMapSetting.server = 'disabled';\n } else if (['hidden', true].includes(nuxtSourceMap.server)) {\n logKeepEnabledSourceMapSetting(sentryModuleOptions, 'sourcemap.server', nuxtSourceMap.server.toString());\n previousUserSourceMapSetting.server = 'enabled';\n } else {\n nuxt.options.sourcemap.server = 'hidden';\n isDebug && logSentryEnablesSourceMap('sourcemap.server', 'hidden');\n previousUserSourceMapSetting.server = 'unset';\n }\n }\n\n return previousUserSourceMapSetting;\n}\n\n/** Logs warnings about potentially conflicting source map settings.\n * Configures `sourcemapExcludeSources` in Nitro to make source maps usable in Sentry.\n *\n * only exported for testing\n */\nexport function validateNitroSourceMapSettings(\n nuxt: { options: { sourcemap?: SourceMapSetting | { server?: SourceMapSetting } } },\n nitroConfig: NitroConfig,\n sentryModuleOptions: SentryNuxtModuleOptions,\n): void {\n const isDebug = sentryModuleOptions.debug;\n const nuxtSourceMap = extractNuxtSourceMapSetting(nuxt, 'server');\n\n // NITRO CONFIG ---\n\n validateDifferentSourceMapSettings({\n nuxtSettingKey: 'sourcemap.server',\n nuxtSettingValue: nuxtSourceMap,\n otherSettingKey: 'nitro.sourceMap',\n otherSettingValue: nitroConfig.sourceMap,\n });\n\n // ROLLUP CONFIG ---\n\n nitroConfig.rollupConfig = nitroConfig.rollupConfig || {};\n nitroConfig.rollupConfig.output = nitroConfig.rollupConfig.output || { sourcemap: undefined };\n const nitroRollupSourceMap = nitroConfig.rollupConfig.output.sourcemap;\n\n // We don't override nitro.rollupConfig.output.sourcemap (undefined by default, but overrides all other server-side source map settings)\n if (typeof nitroRollupSourceMap !== 'undefined' && ['hidden', 'inline', true, false].includes(nitroRollupSourceMap)) {\n const settingKey = 'nitro.rollupConfig.output.sourcemap';\n\n validateDifferentSourceMapSettings({\n nuxtSettingKey: 'sourcemap.server',\n nuxtSettingValue: nuxtSourceMap,\n otherSettingKey: settingKey,\n otherSettingValue: nitroRollupSourceMap,\n });\n }\n\n nitroConfig.rollupConfig.output.sourcemapExcludeSources = false;\n if (isDebug) {\n // eslint-disable-next-line no-console\n console.log(\n '[Sentry] Set `sourcemapExcludeSources: false` in the Nuxt config (`nitro.rollupConfig.output`). Source maps will now include the actual code to be able to un-minify code snippets in Sentry.',\n );\n }\n}\n\n/**\n * Validates that source map settings are consistent between Nuxt and Vite/Nitro configurations.\n * Logs a warning if conflicting settings are detected.\n *\n * @internal Only exported for testing.\n */\nexport function validateDifferentSourceMapSettings({\n nuxtSettingKey,\n nuxtSettingValue,\n otherSettingKey,\n otherSettingValue,\n}: {\n nuxtSettingKey: string;\n nuxtSettingValue?: SourceMapSetting;\n otherSettingKey: string;\n otherSettingValue?: SourceMapSetting;\n}): void {\n if (nuxtSettingValue !== otherSettingValue) {\n // eslint-disable-next-line no-console\n console.warn(\n `[Sentry] Source map generation settings are conflicting. Sentry uses \\`${nuxtSettingKey}: ${nuxtSettingValue}\\`. However, a conflicting setting was discovered (\\`${otherSettingKey}: ${otherSettingValue}\\`). This setting was probably explicitly set in your configuration. Sentry won't override this setting but it may affect source maps generation and upload. Without source maps, code snippets on the Sentry Issues page will remain minified.`,\n );\n }\n}\n\nfunction logKeepEnabledSourceMapSetting(\n sentryNuxtModuleOptions: SentryNuxtModuleOptions,\n settingKey: string,\n settingValue: string,\n): void {\n if (sentryNuxtModuleOptions.debug) {\n // eslint-disable-next-line no-console\n console.log(\n `[Sentry] \\`${settingKey}\\` is enabled with \\`${settingValue}\\`. This will correctly un-minify the code snippet on the Sentry Issue Details page.`,\n );\n }\n}\n\nfunction warnExplicitlyDisabledSourceMap(settingKey: string, isDebug: boolean | undefined): void {\n if (isDebug) {\n // eslint-disable-next-line no-console\n console.warn(\n `[Sentry] Source map generation is currently disabled in your Vite configuration (\\`${settingKey}: false \\`). This setting is either a default setting or was explicitly set in your configuration. Sentry won't override this setting. Without source maps, code snippets on the Sentry Issues page will remain minified. To show unminified code, enable source maps in \\`${settingKey}\\` (e.g. by setting them to \\`hidden\\`).`,\n );\n } else {\n // eslint-disable-next-line no-console\n console.warn(`[Sentry] Source map generation (\\`${settingKey}\\`) is disabled in your Vite configuration.`);\n }\n}\n\nfunction logSentryEnablesSourceMap(settingKey: string, settingValue: string): void {\n // eslint-disable-next-line no-console\n console.log(`[Sentry] Enabled source map generation in the build options with \\`${settingKey}: ${settingValue}\\`.`);\n}\n"],"names":[],"mappings":";;;;AAmBO,SAAS,eAAA,CACd,aAAA,EACA,IAAA,EACA,aAAA,EACM;AAGN,EAAA,MAAM,UAAU,aAAA,CAAc,KAAA;AAG9B,EAAA,MAAM,uBAAA,GAA0B,aAAA,CAAc,uBAAA,IAA2B,EAAC;AAE1E,EAAA,MAAM,iBAAA,GACJ,cAAc,UAAA,EAAY,OAAA,KAAY,OAClC,KAAA,GACA,aAAA,CAAc,UAAA,EAAY,OAAA,KAAY,KAAA,GACpC,IAAA;AAAA;AAAA,IAEC,wBAAwB,OAAA,IAAW;AAAA,GAAA;AAG5C,EAAA,MAAM,yBAAA,GAA4B,EAAE,MAAA,EAAQ,IAAA,EAAM,QAAQ,IAAA,EAAK;AAE/D,EAAA,IAAA,CAAK,IAAA,CAAK,gBAAgB,MAAM;AAC9B,IAAA,IAAI,iBAAA,IAAqB,CAAC,IAAA,CAAK,OAAA,CAAQ,OAAO,CAAC,IAAA,CAAK,SAAS,QAAA,EAAU;AAOrE,MAAA,MAAM,yBAAA,GAA4B,2BAAA,CAA4B,IAAA,EAAM,aAAa,CAAA;AAGjF,MAAA,yBAAA,CAA0B,MAAA,GAAS,0BAA0B,MAAA,KAAW,OAAA;AACxE,MAAA,yBAAA,CAA0B,MAAA,GAAS,0BAA0B,MAAA,KAAW,OAAA;AAExE,MAAA,IAAI,OAAA,KAAY,yBAAA,CAA0B,MAAA,IAAU,yBAAA,CAA0B,MAAA,CAAA,EAAS;AACrF,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