Skip to content

Commit

Permalink
feat(nuxt): Only delete public source maps (#14438)
Browse files Browse the repository at this point in the history
As Nuxt generates and keeps server source maps per default, only the
source maps in the public folder are deleted after uploading them to
Sentry.
  • Loading branch information
s1gr1d authored Nov 22, 2024
1 parent b0c3f5f commit 6fbab43
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/nuxt/src/vite/sourceMaps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export function getPluginOptions(
consoleSandbox(() => {
// eslint-disable-next-line no-console
console.log(
'[Sentry] Setting `sentry.sourceMapsUploadOptions.sourcemaps.filesToDeleteAfterUpload: [".*/**/*.map"]` to delete generated source maps after they were uploaded to Sentry.',
'[Sentry] Setting `sentry.sourceMapsUploadOptions.sourcemaps.filesToDeleteAfterUpload: [".*/**/public/**/*.map"]` to delete generated source maps after they were uploaded to Sentry.',
);
});
}
Expand All @@ -108,7 +108,7 @@ export function getPluginOptions(
filesToDeleteAfterUpload: sourceMapsUploadOptions.sourcemaps?.filesToDeleteAfterUpload
? sourceMapsUploadOptions.sourcemaps?.filesToDeleteAfterUpload
: deleteFilesAfterUpload
? ['.*/**/*.map']
? ['.*/**/public/**/*.map']
: undefined,
rewriteSources: (source: string) => normalizePath(source),
...moduleOptions?.unstable_sentryBundlerPluginOptions?.sourcemaps,
Expand Down Expand Up @@ -279,7 +279,7 @@ function warnExplicitlyDisabledSourceMap(settingKey: string): void {
consoleSandbox(() => {
// eslint-disable-next-line no-console
console.warn(
`[Sentry] Parts of source map generation are currently disabled in your Nuxt 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}\`.`,
`[Sentry] Parts of source map generation are currently disabled in your Nuxt 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\`).`,
);
});
}
Expand Down

0 comments on commit 6fbab43

Please sign in to comment.