Skip to content

Commit 6fbab43

Browse files
authored
feat(nuxt): Only delete public source maps (#14438)
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.
1 parent b0c3f5f commit 6fbab43

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/nuxt/src/vite/sourceMaps.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export function getPluginOptions(
8181
consoleSandbox(() => {
8282
// eslint-disable-next-line no-console
8383
console.log(
84-
'[Sentry] Setting `sentry.sourceMapsUploadOptions.sourcemaps.filesToDeleteAfterUpload: [".*/**/*.map"]` to delete generated source maps after they were uploaded to Sentry.',
84+
'[Sentry] Setting `sentry.sourceMapsUploadOptions.sourcemaps.filesToDeleteAfterUpload: [".*/**/public/**/*.map"]` to delete generated source maps after they were uploaded to Sentry.',
8585
);
8686
});
8787
}
@@ -108,7 +108,7 @@ export function getPluginOptions(
108108
filesToDeleteAfterUpload: sourceMapsUploadOptions.sourcemaps?.filesToDeleteAfterUpload
109109
? sourceMapsUploadOptions.sourcemaps?.filesToDeleteAfterUpload
110110
: deleteFilesAfterUpload
111-
? ['.*/**/*.map']
111+
? ['.*/**/public/**/*.map']
112112
: undefined,
113113
rewriteSources: (source: string) => normalizePath(source),
114114
...moduleOptions?.unstable_sentryBundlerPluginOptions?.sourcemaps,
@@ -279,7 +279,7 @@ function warnExplicitlyDisabledSourceMap(settingKey: string): void {
279279
consoleSandbox(() => {
280280
// eslint-disable-next-line no-console
281281
console.warn(
282-
`[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}\`.`,
282+
`[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\`).`,
283283
);
284284
});
285285
}

0 commit comments

Comments
 (0)