Skip to content

Commit 5164de0

Browse files
committed
wip options
1 parent cf61939 commit 5164de0

File tree

3 files changed

+25
-2
lines changed

3 files changed

+25
-2
lines changed

packages/react-router/src/vite/makeCustomSentryVitePlugins.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ export async function makeCustomSentryVitePlugins(options: SentryReactRouterPlug
2828
metaFramework: 'react-router',
2929
},
3030
},
31-
31+
sourcemaps: {
32+
...sourceMapsUploadOptions,
33+
...unstable_sentryVitePluginOptions?.sourcemaps,
34+
},
3235
...unstable_sentryVitePluginOptions,
3336
}) as Plugin[];
3437

packages/react-router/src/vite/plugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export async function sentryReactRouter(
1717
): Promise<Plugin[]> {
1818
const plugins: Plugin[] = [];
1919

20-
if (process.env.NODE_ENV !== 'development' && config.command === 'build') {
20+
if (process.env.NODE_ENV !== 'development' && config.command === 'build' && config.mode !== 'development') {
2121
plugins.push(makeEnableSourceMapsPlugin(options));
2222
plugins.push(...(await makeCustomSentryVitePlugins(options)));
2323
}

packages/react-router/src/vite/types.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,26 @@ type SourceMapsOptions = {
2626
* The globbing patterns follow the implementation of the glob package. (https://www.npmjs.com/package/glob)
2727
*/
2828
filesToDeleteAfterUpload?: string | Array<string>;
29+
30+
/**
31+
* Options related to managing the Sentry releases for a build.
32+
*
33+
* More info: https://docs.sentry.io/product/releases/
34+
*/
35+
release?: {
36+
/**
37+
* Unique identifier for the release you want to create.
38+
*
39+
* This value can also be specified via the `SENTRY_RELEASE` environment variable.
40+
*
41+
* Defaults to automatically detecting a value for your environment.
42+
* This includes values for Cordova, Heroku, AWS CodeBuild, CircleCI, Xcode, and Gradle, and otherwise uses the git `HEAD`'s commit SHA.
43+
* (the latter requires access to git CLI and for the root directory to be a valid repository)
44+
*
45+
* If you didn't provide a value and the plugin can't automatically detect one, no release will be created.
46+
*/
47+
name?: string;
48+
};
2949
};
3050

3151
type BundleSizeOptimizationOptions = {

0 commit comments

Comments
 (0)