File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -87,11 +87,17 @@ const getHost = (req: { get: (key: string) => string | undefined }) =>
8787
8888const MODE = process . env . NODE_ENV
8989
90- if ( MODE === 'production' && process . env . SENTRY_DSN ) {
90+ const SHOULD_INIT_SENTRY =
91+ MODE === 'production' &&
92+ Boolean ( process . env . SENTRY_DSN ) &&
93+ // `start:mocks` (used in CI + local e2e) runs with `MOCKS=true`.
94+ process . env . MOCKS !== 'true'
95+
96+ if ( SHOULD_INIT_SENTRY ) {
9197 void import ( './utils/monitoring.js' ) . then ( ( { init } ) => init ( ) )
9298}
9399
94- if ( MODE === 'production' ) {
100+ if ( SHOULD_INIT_SENTRY ) {
95101 sentryInit ( {
96102 dsn : process . env . SENTRY_DSN ,
97103 tracesSampleRate : 0.3 ,
Original file line number Diff line number Diff line change @@ -15,6 +15,8 @@ if (SENTRY_UPLOAD && MODE === 'production') {
1515 const authToken = process . env . SENTRY_AUTH_TOKEN
1616 const project = process . env . SENTRY_PROJECT
1717 const org = process . env . SENTRY_ORG
18+ // New-style Sentry auth tokens (prefix "sntrys_") embed the org, so SENTRY_ORG
19+ // is not required when using one.
1820 const tokenImpliesOrg = Boolean ( authToken ?. startsWith ( 'sntrys_' ) )
1921
2022 // If upload is "on" but required settings are missing, the Sentry plugin will
@@ -66,6 +68,10 @@ export default defineConfig(async () => {
6668 : null ,
6769 ] ,
6870 build : {
71+ // This is an OSS project, so it's fine to generate "regular" sourcemaps.
72+ // If we ever want sourcemaps upload without exposing them publicly, switch
73+ // to `sourcemap: 'hidden'` (and keep uploading to Sentry).
74+ sourcemap : true ,
6975 cssMinify : MODE === 'production' ,
7076 rollupOptions : {
7177 external : [ / n o d e : .* / , 'stream' , 'crypto' ] ,
You can’t perform that action at this time.
0 commit comments