Skip to content
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ export async function makeCustomSentryVitePlugins(options: SentryReactRouterBuil
release,
} = options;

// Destructure keys that are merged explicitly below so the trailing spread
// cannot overwrite them with the user's raw value.
const { sourcemaps: userSourcemaps, ...restUnstableVitePluginOptions } =
unstable_sentryVitePluginOptions ?? {};

const sentryVitePlugins = sentryVitePlugin({
applicationKey,
authToken: authToken ?? process.env.SENTRY_AUTH_TOKEN,
Expand All @@ -45,9 +50,9 @@ export async function makeCustomSentryVitePlugins(options: SentryReactRouterBuil
// will be handled in buildEnd hook
sourcemaps: {
disable: true,
...unstable_sentryVitePluginOptions?.sourcemaps,
...userSourcemaps,
},
...unstable_sentryVitePluginOptions,
...restUnstableVitePluginOptions,
}) as Plugin[];

return sentryVitePlugins;
Expand Down