@sentry/nuxt 10.53.1 → 10.54.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/client/piniaIntegration.js +7 -19
- package/build/cjs/client/piniaIntegration.js.map +1 -1
- package/build/cjs/client/sdk.js +2 -9
- package/build/cjs/client/sdk.js.map +1 -1
- package/build/cjs/client/vueIntegration.js +3 -10
- package/build/cjs/client/vueIntegration.js.map +1 -1
- package/build/cjs/common/debug-build.js +0 -5
- package/build/cjs/common/debug-build.js.map +1 -1
- package/build/cjs/module.js +52 -107
- package/build/cjs/module.js.map +1 -1
- package/build/cjs/server/sdk.js +20 -60
- package/build/cjs/server/sdk.js.map +1 -1
- package/build/cjs/vendor/server-template.js +0 -6
- package/build/cjs/vendor/server-template.js.map +1 -1
- package/build/cjs/vite/addServerConfig.js +45 -144
- package/build/cjs/vite/addServerConfig.js.map +1 -1
- package/build/cjs/vite/databaseConfig.js +10 -32
- package/build/cjs/vite/databaseConfig.js.map +1 -1
- package/build/cjs/vite/middlewareConfig.js +11 -46
- package/build/cjs/vite/middlewareConfig.js.map +1 -1
- package/build/cjs/vite/sentryVitePlugin.js +7 -24
- package/build/cjs/vite/sentryVitePlugin.js.map +1 -1
- package/build/cjs/vite/sourceMaps.js +89 -248
- package/build/cjs/vite/sourceMaps.js.map +1 -1
- package/build/cjs/vite/storageConfig.js +4 -10
- package/build/cjs/vite/storageConfig.js.map +1 -1
- package/build/cjs/vite/utils.js +51 -143
- package/build/cjs/vite/utils.js.map +1 -1
- package/build/esm/client/piniaIntegration.js +7 -19
- package/build/esm/client/piniaIntegration.js.map +1 -1
- package/build/esm/client/sdk.js +2 -9
- package/build/esm/client/sdk.js.map +1 -1
- package/build/esm/client/vueIntegration.js +3 -10
- package/build/esm/client/vueIntegration.js.map +1 -1
- package/build/esm/common/debug-build.js +0 -5
- package/build/esm/common/debug-build.js.map +1 -1
- package/build/esm/module.js +52 -107
- package/build/esm/module.js.map +1 -1
- package/build/esm/package.json +1 -1
- package/build/esm/server/sdk.js +20 -60
- package/build/esm/server/sdk.js.map +1 -1
- package/build/esm/vendor/server-template.js +0 -6
- package/build/esm/vendor/server-template.js.map +1 -1
- package/build/esm/vite/addServerConfig.js +45 -144
- package/build/esm/vite/addServerConfig.js.map +1 -1
- package/build/esm/vite/databaseConfig.js +10 -32
- package/build/esm/vite/databaseConfig.js.map +1 -1
- package/build/esm/vite/middlewareConfig.js +11 -46
- package/build/esm/vite/middlewareConfig.js.map +1 -1
- package/build/esm/vite/sentryVitePlugin.js +7 -24
- package/build/esm/vite/sentryVitePlugin.js.map +1 -1
- package/build/esm/vite/sourceMaps.js +89 -248
- package/build/esm/vite/sourceMaps.js.map +1 -1
- package/build/esm/vite/storageConfig.js +4 -10
- package/build/esm/vite/storageConfig.js.map +1 -1
- package/build/esm/vite/utils.js +51 -143
- package/build/esm/vite/utils.js.map +1 -1
- package/build/module/module.d.mts +17 -0
- package/build/module/module.d.ts +17 -0
- package/build/module/module.json +1 -1
- package/build/module/module.mjs +6 -6
- package/build/types/common/types.d.ts +17 -0
- package/build/types/common/types.d.ts.map +1 -1
- package/build/types/vite/utils.d.ts +2 -1
- package/build/types/vite/utils.d.ts.map +1 -1
- package/package.json +8 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"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":";;;;AAQA;AACA;AACA;;AAMA;AACA;AACA;AACO,SAAS,eAAe;AAC/B,EAAE,aAAa;AACf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U,CAAC,2CAA2C,CAAC,CAAC;AAC9G,EAAE;AACF;;AAEA,SAAS,yBAAyB,CAAC,UAAU,EAAU,YAAY,EAAgB;AACnF;AACA,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,mEAAmE,EAAE,UAAU,CAAC,EAAE,EAAE,YAAY,CAAC,GAAG,CAAC,CAAC;AACrH;;;;"}
|
|
1
|
+
{"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,EAA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AAA;AAAA,EACA,eAAA;AAAA,EACA;AACF,CAAA,EAKS;AACP,EAAA,IAAI,qBAAqB,iBAAA,EAAmB;AAE1C,IAAA,OAAA,CAAQ,IAAA;AAAA,MACN,0EAA0E,cAAc,CAAA,EAAA,EAAK,gBAAgB,CAAA,qDAAA,EAAwD,eAAe,KAAK,iBAAiB,CAAA,+OAAA;AAAA,KAC5M;AAAA,EACF;AACF;AAEA,SAAS,8BAAA,CACP,uBAAA,EACA,UAAA,EACA,YAAA,EACM;AACN,EAAA,IAAI,wBAAwB,KAAA,EAAO;AAEjC,IAAA,OAAA,CAAQ,GAAA;AAAA,MACN,CAAA,WAAA,EAAc,UAAU,CAAA,qBAAA,EAAwB,YAAY,CAAA,oFAAA;AAAA,KAC9D;AAAA,EACF;AACF;AAEA,SAAS,+BAAA,CAAgC,YAAoB,OAAA,EAAoC;AAC/F,EAAA,IAAI,OAAA,EAAS;AAEX,IAAA,OAAA,CAAQ,IAAA;AAAA,MACN,CAAA,mFAAA,EAAsF,UAAU,CAAA,2QAAA,EAA8Q,UAAU,CAAA,wCAAA;AAAA,KAC1X;AAAA,EACF,CAAA,MAAO;AAEL,IAAA,OAAA,CAAQ,IAAA,CAAK,CAAA,kCAAA,EAAqC,UAAU,CAAA,2CAAA,CAA6C,CAAA;AAAA,EAC3G;AACF;AAEA,SAAS,yBAAA,CAA0B,YAAoB,YAAA,EAA4B;AAEjF,EAAA,OAAA,CAAQ,GAAA,CAAI,CAAA,mEAAA,EAAsE,UAAU,CAAA,EAAA,EAAK,YAAY,CAAA,GAAA,CAAK,CAAA;AACpH;;;;"}
|
|
@@ -1,25 +1,19 @@
|
|
|
1
1
|
import { createResolver, addServerPlugin } from '@nuxt/kit';
|
|
2
2
|
import { addServerTemplate } from '../vendor/server-template.js';
|
|
3
3
|
|
|
4
|
-
/**
|
|
5
|
-
* Prepares the storage config export to be used in the runtime storage instrumentation.
|
|
6
|
-
*/
|
|
7
4
|
function addStorageInstrumentation(nuxt, isLegacyNitro) {
|
|
8
5
|
const moduleDirResolver = createResolver(import.meta.url);
|
|
9
6
|
const userStorageMounts = Object.keys(nuxt.options.nitro.storage || {});
|
|
10
|
-
|
|
11
|
-
// Create a virtual module to pass this data to runtime
|
|
12
7
|
addServerTemplate({
|
|
13
|
-
filename:
|
|
8
|
+
filename: "#sentry/storage-config.mjs",
|
|
14
9
|
getContents: () => {
|
|
15
10
|
return `export const userStorageMounts = ${JSON.stringify(userStorageMounts)};`;
|
|
16
|
-
}
|
|
11
|
+
}
|
|
17
12
|
});
|
|
18
|
-
|
|
19
13
|
if (isLegacyNitro) {
|
|
20
|
-
addServerPlugin(moduleDirResolver.resolve(
|
|
14
|
+
addServerPlugin(moduleDirResolver.resolve("./runtime/plugins/storage-legacy.server"));
|
|
21
15
|
} else {
|
|
22
|
-
addServerPlugin(moduleDirResolver.resolve(
|
|
16
|
+
addServerPlugin(moduleDirResolver.resolve("./runtime/plugins/storage.server"));
|
|
23
17
|
}
|
|
24
18
|
}
|
|
25
19
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storageConfig.js","sources":["../../../src/vite/storageConfig.ts"],"sourcesContent":["import { addServerPlugin, createResolver } from '@nuxt/kit';\nimport type { Nuxt } from '@nuxt/schema';\nimport { addServerTemplate } from '../vendor/server-template';\n\n/**\n * Prepares the storage config export to be used in the runtime storage instrumentation.\n */\nexport function addStorageInstrumentation(nuxt: Nuxt, isLegacyNitro: boolean): void {\n const moduleDirResolver = createResolver(import.meta.url);\n const userStorageMounts = Object.keys(nuxt.options.nitro.storage || {});\n\n // Create a virtual module to pass this data to runtime\n addServerTemplate({\n filename: '#sentry/storage-config.mjs',\n getContents: () => {\n return `export const userStorageMounts = ${JSON.stringify(userStorageMounts)};`;\n },\n });\n\n if (isLegacyNitro) {\n addServerPlugin(moduleDirResolver.resolve('./runtime/plugins/storage-legacy.server'));\n } else {\n addServerPlugin(moduleDirResolver.resolve('./runtime/plugins/storage.server'));\n }\n}\n"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"storageConfig.js","sources":["../../../src/vite/storageConfig.ts"],"sourcesContent":["import { addServerPlugin, createResolver } from '@nuxt/kit';\nimport type { Nuxt } from '@nuxt/schema';\nimport { addServerTemplate } from '../vendor/server-template';\n\n/**\n * Prepares the storage config export to be used in the runtime storage instrumentation.\n */\nexport function addStorageInstrumentation(nuxt: Nuxt, isLegacyNitro: boolean): void {\n const moduleDirResolver = createResolver(import.meta.url);\n const userStorageMounts = Object.keys(nuxt.options.nitro.storage || {});\n\n // Create a virtual module to pass this data to runtime\n addServerTemplate({\n filename: '#sentry/storage-config.mjs',\n getContents: () => {\n return `export const userStorageMounts = ${JSON.stringify(userStorageMounts)};`;\n },\n });\n\n if (isLegacyNitro) {\n addServerPlugin(moduleDirResolver.resolve('./runtime/plugins/storage-legacy.server'));\n } else {\n addServerPlugin(moduleDirResolver.resolve('./runtime/plugins/storage.server'));\n }\n}\n"],"names":[],"mappings":";;;AAOO,SAAS,yBAAA,CAA0B,MAAY,aAAA,EAA8B;AAClF,EAAA,MAAM,iBAAA,GAAoB,cAAA,CAAe,MAAA,CAAA,IAAA,CAAY,GAAG,CAAA;AACxD,EAAA,MAAM,iBAAA,GAAoB,OAAO,IAAA,CAAK,IAAA,CAAK,QAAQ,KAAA,CAAM,OAAA,IAAW,EAAE,CAAA;AAGtE,EAAA,iBAAA,CAAkB;AAAA,IAChB,QAAA,EAAU,4BAAA;AAAA,IACV,aAAa,MAAM;AACjB,MAAA,OAAO,CAAA,iCAAA,EAAoC,IAAA,CAAK,SAAA,CAAU,iBAAiB,CAAC,CAAA,CAAA,CAAA;AAAA,IAC9E;AAAA,GACD,CAAA;AAED,EAAA,IAAI,aAAA,EAAe;AACjB,IAAA,eAAA,CAAgB,iBAAA,CAAkB,OAAA,CAAQ,yCAAyC,CAAC,CAAA;AAAA,EACtF,CAAA,MAAO;AACL,IAAA,eAAA,CAAgB,iBAAA,CAAkB,OAAA,CAAQ,kCAAkC,CAAC,CAAA;AAAA,EAC/E;AACF;;;;"}
|
package/build/esm/vite/utils.js
CHANGED
|
@@ -1,47 +1,34 @@
|
|
|
1
1
|
import { consoleSandbox } from '@sentry/core';
|
|
2
2
|
import * as fs from 'fs';
|
|
3
3
|
import * as path from 'path';
|
|
4
|
+
import { resolvePath } from '@nuxt/kit';
|
|
4
5
|
|
|
5
|
-
/**
|
|
6
|
-
* Gets the major version of the installed nitro package.
|
|
7
|
-
* Returns 2 as the default if nitro is not found or the version cannot be determined.
|
|
8
|
-
*/
|
|
9
6
|
async function getNitroMajorVersion() {
|
|
10
7
|
try {
|
|
11
8
|
const { getPackageInfo } = await import('local-pkg');
|
|
12
|
-
const info = await getPackageInfo(
|
|
9
|
+
const info = await getPackageInfo("nitro");
|
|
13
10
|
if (info?.version) {
|
|
14
|
-
const major = parseInt(info.version.split(
|
|
11
|
+
const major = parseInt(info.version.split(".")[0] ?? "2", 10);
|
|
15
12
|
return isNaN(major) ? 2 : major;
|
|
16
13
|
}
|
|
17
14
|
} catch {
|
|
18
|
-
// If local-pkg is unavailable or nitro is not found, default to v2
|
|
19
15
|
}
|
|
20
16
|
return 2;
|
|
21
17
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
* Find the default SDK init file for the given type (client or server).
|
|
25
|
-
* The sentry.server.config file is prioritized over the instrument.server file.
|
|
26
|
-
*/
|
|
27
|
-
function findDefaultSdkInitFile(type, nuxt) {
|
|
28
|
-
const possibleFileExtensions = ['ts', 'js', 'mjs', 'cjs', 'mts', 'cts'];
|
|
18
|
+
async function findDefaultSdkInitFile(type, nuxt, options) {
|
|
19
|
+
const possibleFileExtensions = ["ts", "js", "mjs", "cjs", "mts", "cts"];
|
|
29
20
|
const relativePaths = [];
|
|
30
|
-
|
|
31
|
-
if (type === 'server') {
|
|
21
|
+
if (type === "server") {
|
|
32
22
|
for (const ext of possibleFileExtensions) {
|
|
33
23
|
relativePaths.push(`sentry.${type}.config.${ext}`);
|
|
34
|
-
relativePaths.push(path.join(
|
|
24
|
+
relativePaths.push(path.join("public", `instrument.${type}.${ext}`));
|
|
35
25
|
}
|
|
36
26
|
} else {
|
|
37
27
|
for (const ext of possibleFileExtensions) {
|
|
38
28
|
relativePaths.push(`sentry.${type}.config.${ext}`);
|
|
39
29
|
}
|
|
40
30
|
}
|
|
41
|
-
|
|
42
|
-
// Get layers from highest priority to lowest
|
|
43
|
-
const layers = [...(nuxt?.options._layers ?? [])].reverse();
|
|
44
|
-
|
|
31
|
+
const layers = [...nuxt?.options._layers ?? []].reverse();
|
|
45
32
|
for (const layer of layers) {
|
|
46
33
|
for (const relativePath of relativePaths) {
|
|
47
34
|
const fullPath = path.resolve(layer.cwd, relativePath);
|
|
@@ -50,174 +37,95 @@ function findDefaultSdkInitFile(type, nuxt) {
|
|
|
50
37
|
}
|
|
51
38
|
}
|
|
52
39
|
}
|
|
53
|
-
|
|
54
|
-
// As a fallback, also check CWD (left for pure compatibility)
|
|
55
|
-
const cwd = process.cwd();
|
|
40
|
+
const rootDir = options?.configDir ? await resolvePath(options.configDir, { type: "dir" }) : process.cwd();
|
|
56
41
|
for (const relativePath of relativePaths) {
|
|
57
|
-
const fullPath = path.resolve(
|
|
42
|
+
const fullPath = path.resolve(rootDir, relativePath);
|
|
58
43
|
if (fs.existsSync(fullPath)) {
|
|
59
44
|
return fullPath;
|
|
60
45
|
}
|
|
61
46
|
}
|
|
62
|
-
|
|
63
|
-
return undefined;
|
|
47
|
+
return void 0;
|
|
64
48
|
}
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Extracts the filename from a node command with a path.
|
|
68
|
-
*/
|
|
69
49
|
function getFilenameFromNodeStartCommand(nodeCommand) {
|
|
70
50
|
const regex = /[^/\\]+\.[^/\\]+$/;
|
|
71
51
|
const match = nodeCommand.match(regex);
|
|
72
52
|
return match ? match[0] : null;
|
|
73
53
|
}
|
|
74
|
-
|
|
75
|
-
const
|
|
76
|
-
const
|
|
77
|
-
const
|
|
78
|
-
const QUERY_END_INDICATOR = 'SENTRY-QUERY-END';
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Strips the Sentry query part from a path.
|
|
82
|
-
* Example: example/path?sentry-query-wrapped-entry?sentry-query-functions-reexport=foo,SENTRY-QUERY-END -> /example/path
|
|
83
|
-
*
|
|
84
|
-
* Only exported for testing.
|
|
85
|
-
*/
|
|
54
|
+
const SENTRY_WRAPPED_ENTRY = "?sentry-query-wrapped-entry";
|
|
55
|
+
const SENTRY_WRAPPED_FUNCTIONS = "?sentry-query-wrapped-functions=";
|
|
56
|
+
const SENTRY_REEXPORTED_FUNCTIONS = "?sentry-query-reexported-functions=";
|
|
57
|
+
const QUERY_END_INDICATOR = "SENTRY-QUERY-END";
|
|
86
58
|
function removeSentryQueryFromPath(url) {
|
|
87
|
-
// oxlint-disable-next-line sdk/no-regexp-constructor
|
|
88
59
|
const regex = new RegExp(`\\${SENTRY_WRAPPED_ENTRY}.*?\\${QUERY_END_INDICATOR}`);
|
|
89
|
-
return url.replace(regex,
|
|
60
|
+
return url.replace(regex, "");
|
|
90
61
|
}
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Extracts and sanitizes function re-export and function wrap query parameters from a query string.
|
|
94
|
-
* If it is a default export, it is not considered for re-exporting.
|
|
95
|
-
*
|
|
96
|
-
* Only exported for testing.
|
|
97
|
-
*/
|
|
98
62
|
function extractFunctionReexportQueryParameters(query) {
|
|
99
|
-
// Regex matches the comma-separated params between the functions query
|
|
100
|
-
// oxlint-disable-next-line sdk/no-regexp-constructor
|
|
101
63
|
const wrapRegex = new RegExp(
|
|
102
|
-
`\\${SENTRY_WRAPPED_FUNCTIONS}(.*?)(\\${QUERY_END_INDICATOR}|\\${SENTRY_REEXPORTED_FUNCTIONS})
|
|
64
|
+
`\\${SENTRY_WRAPPED_FUNCTIONS}(.*?)(\\${QUERY_END_INDICATOR}|\\${SENTRY_REEXPORTED_FUNCTIONS})`
|
|
103
65
|
);
|
|
104
|
-
// oxlint-disable-next-line sdk/no-regexp-constructor
|
|
105
66
|
const reexportRegex = new RegExp(`\\${SENTRY_REEXPORTED_FUNCTIONS}(.*?)(\\${QUERY_END_INDICATOR})`);
|
|
106
|
-
|
|
107
67
|
const wrapMatch = query.match(wrapRegex);
|
|
108
68
|
const reexportMatch = query.match(reexportRegex);
|
|
109
|
-
|
|
110
|
-
const
|
|
111
|
-
wrapMatch?.[1]
|
|
112
|
-
?.split(',')
|
|
113
|
-
.filter(param => param !== '')
|
|
114
|
-
// Sanitize, as code could be injected with another rollup plugin
|
|
115
|
-
.map((str) => str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')) || [];
|
|
116
|
-
|
|
117
|
-
const reexport =
|
|
118
|
-
reexportMatch?.[1]
|
|
119
|
-
?.split(',')
|
|
120
|
-
.filter(param => param !== '' && param !== 'default')
|
|
121
|
-
// Sanitize, as code could be injected with another rollup plugin
|
|
122
|
-
.map((str) => str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')) || [];
|
|
123
|
-
|
|
69
|
+
const wrap = wrapMatch?.[1]?.split(",").filter((param) => param !== "").map((str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")) || [];
|
|
70
|
+
const reexport = reexportMatch?.[1]?.split(",").filter((param) => param !== "" && param !== "default").map((str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")) || [];
|
|
124
71
|
return { wrap, reexport };
|
|
125
72
|
}
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* Constructs a comma-separated string with all functions that need to be re-exported later from the server entry.
|
|
129
|
-
* It uses Rollup's `exportedBindings` to determine the functions to re-export. Functions which should be wrapped
|
|
130
|
-
* (e.g. serverless handlers) are wrapped by Sentry.
|
|
131
|
-
*/
|
|
132
|
-
function constructWrappedFunctionExportQuery(
|
|
133
|
-
exportedBindings,
|
|
134
|
-
entrypointWrappedFunctions,
|
|
135
|
-
debug,
|
|
136
|
-
) {
|
|
73
|
+
function constructWrappedFunctionExportQuery(exportedBindings, entrypointWrappedFunctions, debug) {
|
|
137
74
|
const functionsToExport = {
|
|
138
75
|
wrap: [],
|
|
139
|
-
reexport: []
|
|
76
|
+
reexport: []
|
|
140
77
|
};
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
// The key `.` refers to exports within the current file, while other keys show from where exports were imported first.
|
|
144
|
-
Object.values(exportedBindings || {}).forEach(functions =>
|
|
145
|
-
functions.forEach(fn => {
|
|
78
|
+
Object.values(exportedBindings || {}).forEach(
|
|
79
|
+
(functions) => functions.forEach((fn) => {
|
|
146
80
|
if (entrypointWrappedFunctions.includes(fn)) {
|
|
147
81
|
functionsToExport.wrap.push(fn);
|
|
148
82
|
} else {
|
|
149
83
|
functionsToExport.reexport.push(fn);
|
|
150
84
|
}
|
|
151
|
-
})
|
|
85
|
+
})
|
|
152
86
|
);
|
|
153
|
-
|
|
154
87
|
if (debug && functionsToExport.wrap.length === 0) {
|
|
155
|
-
consoleSandbox(
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
88
|
+
consoleSandbox(
|
|
89
|
+
() => (
|
|
90
|
+
// eslint-disable-next-line no-console
|
|
91
|
+
console.warn(
|
|
92
|
+
"[Sentry] No functions found to wrap. In case the server needs to export async functions other than `handler` or `server`, consider adding the name(s) to Sentry's build options `sentry.experimental_entrypointWrappedFunctions` in `nuxt.config.ts`."
|
|
93
|
+
)
|
|
94
|
+
)
|
|
160
95
|
);
|
|
161
96
|
}
|
|
162
|
-
|
|
163
|
-
const
|
|
164
|
-
|
|
165
|
-
: '';
|
|
166
|
-
const reexportQuery = functionsToExport.reexport.length
|
|
167
|
-
? `${SENTRY_REEXPORTED_FUNCTIONS}${functionsToExport.reexport.join(',')}`
|
|
168
|
-
: '';
|
|
169
|
-
|
|
170
|
-
return [wrapQuery, reexportQuery].join('');
|
|
97
|
+
const wrapQuery = functionsToExport.wrap.length ? `${SENTRY_WRAPPED_FUNCTIONS}${functionsToExport.wrap.join(",")}` : "";
|
|
98
|
+
const reexportQuery = functionsToExport.reexport.length ? `${SENTRY_REEXPORTED_FUNCTIONS}${functionsToExport.reexport.join(",")}` : "";
|
|
99
|
+
return [wrapQuery, reexportQuery].join("");
|
|
171
100
|
}
|
|
172
|
-
|
|
173
|
-
/**
|
|
174
|
-
* Constructs a code snippet with function reexports (can be used in Rollup plugins as a return value for `load()`)
|
|
175
|
-
*/
|
|
176
101
|
function constructFunctionReExport(pathWithQuery, entryId) {
|
|
177
102
|
const { wrap: wrapFunctions, reexport: reexportFunctions } = extractFunctionReexportQueryParameters(pathWithQuery);
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
103
|
+
return wrapFunctions.reduce(
|
|
104
|
+
(functionsCode, currFunctionName) => functionsCode.concat(
|
|
105
|
+
`async function ${currFunctionName}_sentryWrapped(...args) {
|
|
106
|
+
const res = await import(${JSON.stringify(entryId)});
|
|
107
|
+
return res.${currFunctionName}.call(this, ...args);
|
|
108
|
+
}
|
|
109
|
+
export { ${currFunctionName}_sentryWrapped as ${currFunctionName} };
|
|
110
|
+
`
|
|
111
|
+
),
|
|
112
|
+
""
|
|
113
|
+
).concat(
|
|
114
|
+
reexportFunctions.reduce(
|
|
115
|
+
(functionsCode, currFunctionName) => functionsCode.concat(`export { ${currFunctionName} } from ${JSON.stringify(entryId)};`),
|
|
116
|
+
""
|
|
190
117
|
)
|
|
191
|
-
|
|
192
|
-
reexportFunctions.reduce(
|
|
193
|
-
(functionsCode, currFunctionName) =>
|
|
194
|
-
functionsCode.concat(`export { ${currFunctionName} } from ${JSON.stringify(entryId)};`),
|
|
195
|
-
'',
|
|
196
|
-
),
|
|
197
|
-
);
|
|
118
|
+
);
|
|
198
119
|
}
|
|
199
|
-
|
|
200
|
-
/**
|
|
201
|
-
* Sets up alias to work around OpenTelemetry's incomplete ESM imports.
|
|
202
|
-
* https://github.com/getsentry/sentry-javascript/issues/15204
|
|
203
|
-
*
|
|
204
|
-
* OpenTelemetry's @opentelemetry/resources package has incomplete imports missing
|
|
205
|
-
* the .js file extensions (like execAsync for machine-id detection). This causes module resolution
|
|
206
|
-
* errors in certain Nuxt configurations, particularly when local Nuxt modules in Nuxt 4 are present.
|
|
207
|
-
*
|
|
208
|
-
* @see https://nuxt.com/docs/guide/concepts/esm#aliasing-libraries
|
|
209
|
-
*/
|
|
210
120
|
function addOTelCommonJSImportAlias(nuxt, isNitroV3 = false) {
|
|
211
121
|
if (!nuxt.options.dev || isNitroV3) {
|
|
212
122
|
return;
|
|
213
123
|
}
|
|
214
|
-
|
|
215
124
|
if (!nuxt.options.alias) {
|
|
216
125
|
nuxt.options.alias = {};
|
|
217
126
|
}
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
nuxt.options.alias['@opentelemetry/resources'] = '@opentelemetry/resources/build/src/index.js';
|
|
127
|
+
if (!nuxt.options.alias["@opentelemetry/resources"]) {
|
|
128
|
+
nuxt.options.alias["@opentelemetry/resources"] = "@opentelemetry/resources/build/src/index.js";
|
|
221
129
|
}
|
|
222
130
|
}
|
|
223
131
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../../src/vite/utils.ts"],"sourcesContent":["import type { Nuxt } from '@nuxt/schema';\nimport { consoleSandbox } from '@sentry/core';\nimport * as fs from 'fs';\nimport * as path from 'path';\n\n/**\n * Gets the major version of the installed nitro package.\n * Returns 2 as the default if nitro is not found or the version cannot be determined.\n */\nexport async function getNitroMajorVersion(): Promise<number> {\n try {\n const { getPackageInfo } = await import('local-pkg');\n const info = await getPackageInfo('nitro');\n if (info?.version) {\n const major = parseInt(info.version.split('.')[0] ?? '2', 10);\n return isNaN(major) ? 2 : major;\n }\n } catch {\n // If local-pkg is unavailable or nitro is not found, default to v2\n }\n return 2;\n}\n\n/**\n * Find the default SDK init file for the given type (client or server).\n * The sentry.server.config file is prioritized over the instrument.server file.\n */\nexport function findDefaultSdkInitFile(type: 'server' | 'client', nuxt?: Nuxt): string | undefined {\n const possibleFileExtensions = ['ts', 'js', 'mjs', 'cjs', 'mts', 'cts'];\n const relativePaths: string[] = [];\n\n if (type === 'server') {\n for (const ext of possibleFileExtensions) {\n relativePaths.push(`sentry.${type}.config.${ext}`);\n relativePaths.push(path.join('public', `instrument.${type}.${ext}`));\n }\n } else {\n for (const ext of possibleFileExtensions) {\n relativePaths.push(`sentry.${type}.config.${ext}`);\n }\n }\n\n // Get layers from highest priority to lowest\n const layers = [...(nuxt?.options._layers ?? [])].reverse();\n\n for (const layer of layers) {\n for (const relativePath of relativePaths) {\n const fullPath = path.resolve(layer.cwd, relativePath);\n if (fs.existsSync(fullPath)) {\n return fullPath;\n }\n }\n }\n\n // As a fallback, also check CWD (left for pure compatibility)\n const cwd = process.cwd();\n for (const relativePath of relativePaths) {\n const fullPath = path.resolve(cwd, relativePath);\n if (fs.existsSync(fullPath)) {\n return fullPath;\n }\n }\n\n return undefined;\n}\n\n/**\n * Extracts the filename from a node command with a path.\n */\nexport function getFilenameFromNodeStartCommand(nodeCommand: string): string | null {\n const regex = /[^/\\\\]+\\.[^/\\\\]+$/;\n const match = nodeCommand.match(regex);\n return match ? match[0] : null;\n}\n\nexport const SENTRY_WRAPPED_ENTRY = '?sentry-query-wrapped-entry';\nexport const SENTRY_WRAPPED_FUNCTIONS = '?sentry-query-wrapped-functions=';\nexport const SENTRY_REEXPORTED_FUNCTIONS = '?sentry-query-reexported-functions=';\nexport const QUERY_END_INDICATOR = 'SENTRY-QUERY-END';\n\n/**\n * Strips the Sentry query part from a path.\n * Example: example/path?sentry-query-wrapped-entry?sentry-query-functions-reexport=foo,SENTRY-QUERY-END -> /example/path\n *\n * Only exported for testing.\n */\nexport function removeSentryQueryFromPath(url: string): string {\n // oxlint-disable-next-line sdk/no-regexp-constructor\n const regex = new RegExp(`\\\\${SENTRY_WRAPPED_ENTRY}.*?\\\\${QUERY_END_INDICATOR}`);\n return url.replace(regex, '');\n}\n\n/**\n * Extracts and sanitizes function re-export and function wrap query parameters from a query string.\n * If it is a default export, it is not considered for re-exporting.\n *\n * Only exported for testing.\n */\nexport function extractFunctionReexportQueryParameters(query: string): { wrap: string[]; reexport: string[] } {\n // Regex matches the comma-separated params between the functions query\n // oxlint-disable-next-line sdk/no-regexp-constructor\n const wrapRegex = new RegExp(\n `\\\\${SENTRY_WRAPPED_FUNCTIONS}(.*?)(\\\\${QUERY_END_INDICATOR}|\\\\${SENTRY_REEXPORTED_FUNCTIONS})`,\n );\n // oxlint-disable-next-line sdk/no-regexp-constructor\n const reexportRegex = new RegExp(`\\\\${SENTRY_REEXPORTED_FUNCTIONS}(.*?)(\\\\${QUERY_END_INDICATOR})`);\n\n const wrapMatch = query.match(wrapRegex);\n const reexportMatch = query.match(reexportRegex);\n\n const wrap =\n wrapMatch?.[1]\n ?.split(',')\n .filter(param => param !== '')\n // Sanitize, as code could be injected with another rollup plugin\n .map((str: string) => str.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')) || [];\n\n const reexport =\n reexportMatch?.[1]\n ?.split(',')\n .filter(param => param !== '' && param !== 'default')\n // Sanitize, as code could be injected with another rollup plugin\n .map((str: string) => str.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')) || [];\n\n return { wrap, reexport };\n}\n\n/**\n * Constructs a comma-separated string with all functions that need to be re-exported later from the server entry.\n * It uses Rollup's `exportedBindings` to determine the functions to re-export. Functions which should be wrapped\n * (e.g. serverless handlers) are wrapped by Sentry.\n */\nexport function constructWrappedFunctionExportQuery(\n exportedBindings: Record<string, string[]> | null,\n entrypointWrappedFunctions: string[],\n debug?: boolean,\n): string {\n const functionsToExport: { wrap: string[]; reexport: string[] } = {\n wrap: [],\n reexport: [],\n };\n\n // `exportedBindings` can look like this: `{ '.': [ 'handler' ] }` or `{ '.': [], './firebase-gen-1.mjs': [ 'server' ] }`\n // The key `.` refers to exports within the current file, while other keys show from where exports were imported first.\n Object.values(exportedBindings || {}).forEach(functions =>\n functions.forEach(fn => {\n if (entrypointWrappedFunctions.includes(fn)) {\n functionsToExport.wrap.push(fn);\n } else {\n functionsToExport.reexport.push(fn);\n }\n }),\n );\n\n if (debug && functionsToExport.wrap.length === 0) {\n consoleSandbox(() =>\n // eslint-disable-next-line no-console\n console.warn(\n \"[Sentry] No functions found to wrap. In case the server needs to export async functions other than `handler` or `server`, consider adding the name(s) to Sentry's build options `sentry.experimental_entrypointWrappedFunctions` in `nuxt.config.ts`.\",\n ),\n );\n }\n\n const wrapQuery = functionsToExport.wrap.length\n ? `${SENTRY_WRAPPED_FUNCTIONS}${functionsToExport.wrap.join(',')}`\n : '';\n const reexportQuery = functionsToExport.reexport.length\n ? `${SENTRY_REEXPORTED_FUNCTIONS}${functionsToExport.reexport.join(',')}`\n : '';\n\n return [wrapQuery, reexportQuery].join('');\n}\n\n/**\n * Constructs a code snippet with function reexports (can be used in Rollup plugins as a return value for `load()`)\n */\nexport function constructFunctionReExport(pathWithQuery: string, entryId: string): string {\n const { wrap: wrapFunctions, reexport: reexportFunctions } = extractFunctionReexportQueryParameters(pathWithQuery);\n\n return wrapFunctions\n .reduce(\n (functionsCode, currFunctionName) =>\n functionsCode.concat(\n `async function ${currFunctionName}_sentryWrapped(...args) {\\n` +\n ` const res = await import(${JSON.stringify(entryId)});\\n` +\n ` return res.${currFunctionName}.call(this, ...args);\\n` +\n '}\\n' +\n `export { ${currFunctionName}_sentryWrapped as ${currFunctionName} };\\n`,\n ),\n '',\n )\n .concat(\n reexportFunctions.reduce(\n (functionsCode, currFunctionName) =>\n functionsCode.concat(`export { ${currFunctionName} } from ${JSON.stringify(entryId)};`),\n '',\n ),\n );\n}\n\n/**\n * Sets up alias to work around OpenTelemetry's incomplete ESM imports.\n * https://github.com/getsentry/sentry-javascript/issues/15204\n *\n * OpenTelemetry's @opentelemetry/resources package has incomplete imports missing\n * the .js file extensions (like execAsync for machine-id detection). This causes module resolution\n * errors in certain Nuxt configurations, particularly when local Nuxt modules in Nuxt 4 are present.\n *\n * @see https://nuxt.com/docs/guide/concepts/esm#aliasing-libraries\n */\nexport function addOTelCommonJSImportAlias(nuxt: Nuxt, isNitroV3 = false): void {\n if (!nuxt.options.dev || isNitroV3) {\n return;\n }\n\n if (!nuxt.options.alias) {\n nuxt.options.alias = {};\n }\n\n if (!nuxt.options.alias['@opentelemetry/resources']) {\n nuxt.options.alias['@opentelemetry/resources'] = '@opentelemetry/resources/build/src/index.js';\n }\n}\n"],"names":[],"mappings":";;;;AAKA;AACA;AACA;AACA;AACO,eAAe,oBAAoB,GAAoB;AAC9D,EAAE,IAAI;AACN,IAAI,MAAM,EAAE,cAAA,EAAe,GAAI,MAAM,OAAO,WAAW,CAAC;AACxD,IAAI,MAAM,IAAA,GAAO,MAAM,cAAc,CAAC,OAAO,CAAC;AAC9C,IAAI,IAAI,IAAI,EAAE,OAAO,EAAE;AACvB,MAAM,MAAM,QAAQ,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA,IAAK,GAAG,EAAE,EAAE,CAAC;AACnE,MAAM,OAAO,KAAK,CAAC,KAAK,IAAI,CAAA,GAAI,KAAK;AACrC,IAAI;AACJ,EAAE,EAAE,MAAM;AACV;AACA,EAAE;AACF,EAAE,OAAO,CAAC;AACV;;AAEA;AACA;AACA;AACA;AACO,SAAS,sBAAsB,CAAC,IAAI,EAAuB,IAAI,EAA6B;AACnG,EAAE,MAAM,sBAAA,GAAyB,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC;AACzE,EAAE,MAAM,aAAa,GAAa,EAAE;;AAEpC,EAAE,IAAI,IAAA,KAAS,QAAQ,EAAE;AACzB,IAAI,KAAK,MAAM,GAAA,IAAO,sBAAsB,EAAE;AAC9C,MAAM,aAAa,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC,QAA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GAAA,KAAA,EAAA;AACA,EAAA,IAAA,CAAA,IAAA,CAAA,OAAA,CAAA,GAAA,IAAA,SAAA,EAAA;AACA,IAAA;AACA,EAAA;;AAEA,EAAA,IAAA,CAAA,IAAA,CAAA,OAAA,CAAA,KAAA,EAAA;AACA,IAAA,IAAA,CAAA,OAAA,CAAA,KAAA,GAAA,EAAA;AACA,EAAA;;AAEA,EAAA,IAAA,CAAA,IAAA,CAAA,OAAA,CAAA,KAAA,CAAA,0BAAA,CAAA,EAAA;AACA,IAAA,IAAA,CAAA,OAAA,CAAA,KAAA,CAAA,0BAAA,CAAA,GAAA,6CAAA;AACA,EAAA;AACA;;;;"}
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../../src/vite/utils.ts"],"sourcesContent":["import type { Nuxt } from '@nuxt/schema';\nimport { consoleSandbox } from '@sentry/core';\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport type { SentryNuxtModuleOptions } from '../common/types';\nimport { resolvePath } from '@nuxt/kit';\n\n/**\n * Gets the major version of the installed nitro package.\n * Returns 2 as the default if nitro is not found or the version cannot be determined.\n */\nexport async function getNitroMajorVersion(): Promise<number> {\n try {\n const { getPackageInfo } = await import('local-pkg');\n const info = await getPackageInfo('nitro');\n if (info?.version) {\n const major = parseInt(info.version.split('.')[0] ?? '2', 10);\n return isNaN(major) ? 2 : major;\n }\n } catch {\n // If local-pkg is unavailable or nitro is not found, default to v2\n }\n return 2;\n}\n\n/**\n * Find the default SDK init file for the given type (client or server).\n * The sentry.server.config file is prioritized over the instrument.server file.\n */\nexport async function findDefaultSdkInitFile(\n type: 'server' | 'client',\n nuxt?: Nuxt,\n options?: SentryNuxtModuleOptions,\n): Promise<string | undefined> {\n const possibleFileExtensions = ['ts', 'js', 'mjs', 'cjs', 'mts', 'cts'];\n const relativePaths: string[] = [];\n\n if (type === 'server') {\n for (const ext of possibleFileExtensions) {\n relativePaths.push(`sentry.${type}.config.${ext}`);\n relativePaths.push(path.join('public', `instrument.${type}.${ext}`));\n }\n } else {\n for (const ext of possibleFileExtensions) {\n relativePaths.push(`sentry.${type}.config.${ext}`);\n }\n }\n\n // Get layers from highest priority to lowest\n const layers = [...(nuxt?.options._layers ?? [])].reverse();\n\n for (const layer of layers) {\n for (const relativePath of relativePaths) {\n const fullPath = path.resolve(layer.cwd, relativePath);\n if (fs.existsSync(fullPath)) {\n return fullPath;\n }\n }\n }\n\n // As a fallback, also check CWD (left for pure compatibility)\n const rootDir = options?.configDir ? await resolvePath(options.configDir, { type: 'dir' }) : process.cwd();\n for (const relativePath of relativePaths) {\n const fullPath = path.resolve(rootDir, relativePath);\n if (fs.existsSync(fullPath)) {\n return fullPath;\n }\n }\n\n return undefined;\n}\n\n/**\n * Extracts the filename from a node command with a path.\n */\nexport function getFilenameFromNodeStartCommand(nodeCommand: string): string | null {\n const regex = /[^/\\\\]+\\.[^/\\\\]+$/;\n const match = nodeCommand.match(regex);\n return match ? match[0] : null;\n}\n\nexport const SENTRY_WRAPPED_ENTRY = '?sentry-query-wrapped-entry';\nexport const SENTRY_WRAPPED_FUNCTIONS = '?sentry-query-wrapped-functions=';\nexport const SENTRY_REEXPORTED_FUNCTIONS = '?sentry-query-reexported-functions=';\nexport const QUERY_END_INDICATOR = 'SENTRY-QUERY-END';\n\n/**\n * Strips the Sentry query part from a path.\n * Example: example/path?sentry-query-wrapped-entry?sentry-query-functions-reexport=foo,SENTRY-QUERY-END -> /example/path\n *\n * Only exported for testing.\n */\nexport function removeSentryQueryFromPath(url: string): string {\n // oxlint-disable-next-line sdk/no-regexp-constructor\n const regex = new RegExp(`\\\\${SENTRY_WRAPPED_ENTRY}.*?\\\\${QUERY_END_INDICATOR}`);\n return url.replace(regex, '');\n}\n\n/**\n * Extracts and sanitizes function re-export and function wrap query parameters from a query string.\n * If it is a default export, it is not considered for re-exporting.\n *\n * Only exported for testing.\n */\nexport function extractFunctionReexportQueryParameters(query: string): { wrap: string[]; reexport: string[] } {\n // Regex matches the comma-separated params between the functions query\n // oxlint-disable-next-line sdk/no-regexp-constructor\n const wrapRegex = new RegExp(\n `\\\\${SENTRY_WRAPPED_FUNCTIONS}(.*?)(\\\\${QUERY_END_INDICATOR}|\\\\${SENTRY_REEXPORTED_FUNCTIONS})`,\n );\n // oxlint-disable-next-line sdk/no-regexp-constructor\n const reexportRegex = new RegExp(`\\\\${SENTRY_REEXPORTED_FUNCTIONS}(.*?)(\\\\${QUERY_END_INDICATOR})`);\n\n const wrapMatch = query.match(wrapRegex);\n const reexportMatch = query.match(reexportRegex);\n\n const wrap =\n wrapMatch?.[1]\n ?.split(',')\n .filter(param => param !== '')\n // Sanitize, as code could be injected with another rollup plugin\n .map((str: string) => str.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')) || [];\n\n const reexport =\n reexportMatch?.[1]\n ?.split(',')\n .filter(param => param !== '' && param !== 'default')\n // Sanitize, as code could be injected with another rollup plugin\n .map((str: string) => str.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')) || [];\n\n return { wrap, reexport };\n}\n\n/**\n * Constructs a comma-separated string with all functions that need to be re-exported later from the server entry.\n * It uses Rollup's `exportedBindings` to determine the functions to re-export. Functions which should be wrapped\n * (e.g. serverless handlers) are wrapped by Sentry.\n */\nexport function constructWrappedFunctionExportQuery(\n exportedBindings: Record<string, string[]> | null,\n entrypointWrappedFunctions: string[],\n debug?: boolean,\n): string {\n const functionsToExport: { wrap: string[]; reexport: string[] } = {\n wrap: [],\n reexport: [],\n };\n\n // `exportedBindings` can look like this: `{ '.': [ 'handler' ] }` or `{ '.': [], './firebase-gen-1.mjs': [ 'server' ] }`\n // The key `.` refers to exports within the current file, while other keys show from where exports were imported first.\n Object.values(exportedBindings || {}).forEach(functions =>\n functions.forEach(fn => {\n if (entrypointWrappedFunctions.includes(fn)) {\n functionsToExport.wrap.push(fn);\n } else {\n functionsToExport.reexport.push(fn);\n }\n }),\n );\n\n if (debug && functionsToExport.wrap.length === 0) {\n consoleSandbox(() =>\n // eslint-disable-next-line no-console\n console.warn(\n \"[Sentry] No functions found to wrap. In case the server needs to export async functions other than `handler` or `server`, consider adding the name(s) to Sentry's build options `sentry.experimental_entrypointWrappedFunctions` in `nuxt.config.ts`.\",\n ),\n );\n }\n\n const wrapQuery = functionsToExport.wrap.length\n ? `${SENTRY_WRAPPED_FUNCTIONS}${functionsToExport.wrap.join(',')}`\n : '';\n const reexportQuery = functionsToExport.reexport.length\n ? `${SENTRY_REEXPORTED_FUNCTIONS}${functionsToExport.reexport.join(',')}`\n : '';\n\n return [wrapQuery, reexportQuery].join('');\n}\n\n/**\n * Constructs a code snippet with function reexports (can be used in Rollup plugins as a return value for `load()`)\n */\nexport function constructFunctionReExport(pathWithQuery: string, entryId: string): string {\n const { wrap: wrapFunctions, reexport: reexportFunctions } = extractFunctionReexportQueryParameters(pathWithQuery);\n\n return wrapFunctions\n .reduce(\n (functionsCode, currFunctionName) =>\n functionsCode.concat(\n `async function ${currFunctionName}_sentryWrapped(...args) {\\n` +\n ` const res = await import(${JSON.stringify(entryId)});\\n` +\n ` return res.${currFunctionName}.call(this, ...args);\\n` +\n '}\\n' +\n `export { ${currFunctionName}_sentryWrapped as ${currFunctionName} };\\n`,\n ),\n '',\n )\n .concat(\n reexportFunctions.reduce(\n (functionsCode, currFunctionName) =>\n functionsCode.concat(`export { ${currFunctionName} } from ${JSON.stringify(entryId)};`),\n '',\n ),\n );\n}\n\n/**\n * Sets up alias to work around OpenTelemetry's incomplete ESM imports.\n * https://github.com/getsentry/sentry-javascript/issues/15204\n *\n * OpenTelemetry's @opentelemetry/resources package has incomplete imports missing\n * the .js file extensions (like execAsync for machine-id detection). This causes module resolution\n * errors in certain Nuxt configurations, particularly when local Nuxt modules in Nuxt 4 are present.\n *\n * @see https://nuxt.com/docs/guide/concepts/esm#aliasing-libraries\n */\nexport function addOTelCommonJSImportAlias(nuxt: Nuxt, isNitroV3 = false): void {\n if (!nuxt.options.dev || isNitroV3) {\n return;\n }\n\n if (!nuxt.options.alias) {\n nuxt.options.alias = {};\n }\n\n if (!nuxt.options.alias['@opentelemetry/resources']) {\n nuxt.options.alias['@opentelemetry/resources'] = '@opentelemetry/resources/build/src/index.js';\n }\n}\n"],"names":[],"mappings":";;;;;AAWA,eAAsB,oBAAA,GAAwC;AAC5D,EAAA,IAAI;AACF,IAAA,MAAM,EAAE,cAAA,EAAe,GAAI,MAAM,OAAO,WAAW,CAAA;AACnD,IAAA,MAAM,IAAA,GAAO,MAAM,cAAA,CAAe,OAAO,CAAA;AACzC,IAAA,IAAI,MAAM,OAAA,EAAS;AACjB,MAAA,MAAM,KAAA,GAAQ,QAAA,CAAS,IAAA,CAAK,OAAA,CAAQ,KAAA,CAAM,GAAG,CAAA,CAAE,CAAC,CAAA,IAAK,GAAA,EAAK,EAAE,CAAA;AAC5D,MAAA,OAAO,KAAA,CAAM,KAAK,CAAA,GAAI,CAAA,GAAI,KAAA;AAAA,IAC5B;AAAA,EACF,CAAA,CAAA,MAAQ;AAAA,EAER;AACA,EAAA,OAAO,CAAA;AACT;AAMA,eAAsB,sBAAA,CACpB,IAAA,EACA,IAAA,EACA,OAAA,EAC6B;AAC7B,EAAA,MAAM,yBAAyB,CAAC,IAAA,EAAM,MAAM,KAAA,EAAO,KAAA,EAAO,OAAO,KAAK,CAAA;AACtE,EAAA,MAAM,gBAA0B,EAAC;AAEjC,EAAA,IAAI,SAAS,QAAA,EAAU;AACrB,IAAA,KAAA,MAAW,OAAO,sBAAA,EAAwB;AACxC,MAAA,aAAA,CAAc,IAAA,CAAK,CAAA,OAAA,EAAU,IAAI,CAAA,QAAA,EAAW,GAAG,CAAA,CAAE,CAAA;AACjD,MAAA,aAAA,CAAc,IAAA,CAAK,KAAK,IAAA,CAAK,QAAA,EAAU,cAAc,IAAI,CAAA,CAAA,EAAI,GAAG,CAAA,CAAE,CAAC,CAAA;AAAA,IACrE;AAAA,EACF,CAAA,MAAO;AACL,IAAA,KAAA,MAAW,OAAO,sBAAA,EAAwB;AACxC,MAAA,aAAA,CAAc,IA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AAa,CAAA;AAEjH,EAAA,OAAO,aAAA,CACJ,MAAA;AAAA,IACC,CAAC,aAAA,EAAe,gBAAA,KACd,aAAA,CAAc,MAAA;AAAA,MACZ,kBAAkB,gBAAgB,CAAA;AAAA,2BAAA,EACF,IAAA,CAAK,SAAA,CAAU,OAAO,CAAC,CAAA;AAAA,aAAA,EACrC,gBAAgB,CAAA;AAAA;AAAA,SAAA,EAEpB,gBAAgB,qBAAqB,gBAAgB,CAAA;AAAA;AAAA,KACrE;AAAA,IACF;AAAA,GACF,CACC,MAAA;AAAA,IACC,iBAAA,CAAkB,MAAA;AAAA,MAChB,CAAC,aAAA,EAAe,gBAAA,KACd,aAAA,CAAc,MAAA,CAAO,CAAA,SAAA,EAAY,gBAAgB,CAAA,QAAA,EAAW,IAAA,CAAK,SAAA,CAAU,OAAO,CAAC,CAAA,CAAA,CAAG,CAAA;AAAA,MACxF;AAAA;AACF,GACF;AACJ;AAYO,SAAS,0BAAA,CAA2B,IAAA,EAAY,SAAA,GAAY,KAAA,EAAa;AAC9E,EAAA,IAAI,CAAC,IAAA,CAAK,OAAA,CAAQ,GAAA,IAAO,SAAA,EAAW;AAClC,IAAA;AAAA,EACF;AAEA,EAAA,IAAI,CAAC,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO;AACvB,IAAA,IAAA,CAAK,OAAA,CAAQ,QAAQ,EAAC;AAAA,EACxB;AAEA,EAAA,IAAI,CAAC,IAAA,CAAK,OAAA,CAAQ,KAAA,CAAM,0BAA0B,CAAA,EAAG;AACnD,IAAA,IAAA,CAAK,OAAA,CAAQ,KAAA,CAAM,0BAA0B,CAAA,GAAI,6CAAA;AAAA,EACnD;AACF;;;;"}
|
|
@@ -188,6 +188,23 @@ type SentryNuxtModuleOptions = BuildTimeOptionsBase & {
|
|
|
188
188
|
* @default undefined
|
|
189
189
|
*/
|
|
190
190
|
autoInjectServerSentry?: 'top-level-import' | 'experimental_dynamic-import';
|
|
191
|
+
/**
|
|
192
|
+
* Provide the resolved path to a custom Sentry client config file.
|
|
193
|
+
*
|
|
194
|
+
* If not provided, the default location (`<projectRoot>/sentry.(client|server).config.(js|ts)`) will be used to look up the config file.
|
|
195
|
+
* If there is no file at the default location either, the SDK won't be initialized.
|
|
196
|
+
*
|
|
197
|
+
* Resolves the full path to a file or directory, respecting Nuxt alias and extensions options.
|
|
198
|
+
* @example
|
|
199
|
+
*
|
|
200
|
+
* ```ts
|
|
201
|
+
* sentry: {
|
|
202
|
+
* configDir: '~/sentry-config',
|
|
203
|
+
* // Sentry will search for `<rootDir>/<srcDir>/sentry-config/sentry.(client|server).config.(js|ts)` files.
|
|
204
|
+
* }
|
|
205
|
+
* ```
|
|
206
|
+
*/
|
|
207
|
+
configDir?: string;
|
|
191
208
|
/**
|
|
192
209
|
* When `autoInjectServerSentry` is set to `"experimental_dynamic-import"`, the SDK will wrap your Nitro server entrypoint
|
|
193
210
|
* with a dynamic `import()` to ensure all dependencies can be properly instrumented. Any previous exports from the entrypoint are still exported.
|
package/build/module/module.d.ts
CHANGED
|
@@ -188,6 +188,23 @@ type SentryNuxtModuleOptions = BuildTimeOptionsBase & {
|
|
|
188
188
|
* @default undefined
|
|
189
189
|
*/
|
|
190
190
|
autoInjectServerSentry?: 'top-level-import' | 'experimental_dynamic-import';
|
|
191
|
+
/**
|
|
192
|
+
* Provide the resolved path to a custom Sentry client config file.
|
|
193
|
+
*
|
|
194
|
+
* If not provided, the default location (`<projectRoot>/sentry.(client|server).config.(js|ts)`) will be used to look up the config file.
|
|
195
|
+
* If there is no file at the default location either, the SDK won't be initialized.
|
|
196
|
+
*
|
|
197
|
+
* Resolves the full path to a file or directory, respecting Nuxt alias and extensions options.
|
|
198
|
+
* @example
|
|
199
|
+
*
|
|
200
|
+
* ```ts
|
|
201
|
+
* sentry: {
|
|
202
|
+
* configDir: '~/sentry-config',
|
|
203
|
+
* // Sentry will search for `<rootDir>/<srcDir>/sentry-config/sentry.(client|server).config.(js|ts)` files.
|
|
204
|
+
* }
|
|
205
|
+
* ```
|
|
206
|
+
*/
|
|
207
|
+
configDir?: string;
|
|
191
208
|
/**
|
|
192
209
|
* When `autoInjectServerSentry` is set to `"experimental_dynamic-import"`, the SDK will wrap your Nitro server entrypoint
|
|
193
210
|
* with a dynamic `import()` to ensure all dependencies can be properly instrumented. Any previous exports from the entrypoint are still exported.
|