Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ export default defineConfig((config) => {
}
},

sourcemap: true,
// 'hidden' emits maps for Sentry upload but omits //# sourceMappingURL=
// so public /assets never advertise map URLs (esp. when auth token is unset)
sourcemap: 'hidden',
},
server: {
watch: {
Expand Down Expand Up @@ -84,20 +86,20 @@ export default defineConfig((config) => {
}
})

// Keep release on the supported top-level fields. Do not pass `sourcemaps`
// through `unstable_sentryVitePluginOptions` — that overwrites the plugin's
// `sourcemaps.disable: true` and injects a second debug ID per chunk
// (getsentry/sentry-javascript#22929). sentryOnBuildEnd deletes maps via its
// default `${buildDirectory}/**/*.map` glob.
const sentryConfig: SentryReactRouterBuildOptions = {
authToken: process.env.SENTRY_AUTH_TOKEN,
org: process.env.SENTRY_ORG,
project: process.env.SENTRY_PROJECT,

unstable_sentryVitePluginOptions: {
release: {
name: process.env.COMMIT_SHA,
setCommits: {
auto: true,
},
},
sourcemaps: {
filesToDeleteAfterUpload: ['./build/**/*.map'],
release: {
name: process.env.COMMIT_SHA,
setCommits: {
auto: true,
},
},
}
Loading