Skip to content

Commit

Permalink
adjust comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Lms24 committed Feb 19, 2025
1 parent 3d5e232 commit 9bb759d
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions packages/sveltekit/src/vite/sourceMaps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,14 +166,14 @@ export async function makeCustomSentryVitePlugins(options?: CustomSentryVitePlug
console.log(`[Sentry] Enabled source map generation in the build options with \`${settingKey}: "hidden"\`.`);
});

// Including all hidden (`.*`) directories by default so that folders like .vercel,
// .netlify, etc are also cleaned up. Additionally, we include the adapter output
// dir which could be a non-hidden directory, like `build` for the Node adapter.
const defaultFileDeletionGlob = ['./.*/**/*.map', `./${adapterOutputDir}/**/*.map`];

if (userProvidedFilesToDeleteAfterUpload) {
resolveFilesToDeleteAfterUpload(userProvidedFilesToDeleteAfterUpload);
} else {
// Including all hidden (`.*`) directories by default so that folders like .vercel,
// .netlify, etc are also cleaned up. Additionally, we include the adapter output
// dir which could be a non-hidden directory, like `build` for the Node adapter.
const defaultFileDeletionGlob = ['./.*/**/*.map', `./${adapterOutputDir}/**/*.map`];

consoleSandbox(() => {
// eslint-disable-next-line no-console
console.warn(
Expand All @@ -183,8 +183,7 @@ export async function makeCustomSentryVitePlugins(options?: CustomSentryVitePlug
);
});

// In case we enabled source map, we also want to delete them.
// So either use the glob(s) that users specified, or the default one!
// In case we enabled source maps and users didn't specify a glob patter to delete, we set a default pattern:
resolveFilesToDeleteAfterUpload(defaultFileDeletionGlob);
}

Expand Down

0 comments on commit 9bb759d

Please sign in to comment.