Skip to content

Commit 2ca6afa

Browse files
authored
Merge pull request #662 from MicroPyramid/sf_import
feat: Configure Sentry source map uploads using environment variables…
2 parents 9a4df27 + f37731d commit 2ca6afa

1 file changed

Lines changed: 17 additions & 11 deletions

File tree

frontend/vite.config.js

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11
import { sentrySvelteKit } from "@sentry/sveltekit";
22
import tailwindcss from '@tailwindcss/vite';
33
import { sveltekit } from '@sveltejs/kit/vite';
4-
import { defineConfig } from 'vite';
4+
import { defineConfig, loadEnv } from 'vite';
55

6-
export default defineConfig({
7-
plugins: [sentrySvelteKit({
8-
org: "micropyramid-fa",
9-
project: "bottlecrm-app",
10-
autoUploadSourceMaps: !!process.env.PUBLIC_SENTRY_DSN
11-
}), tailwindcss(), sveltekit()],
12-
optimizeDeps: {
13-
exclude: ['esm-env']
14-
}
15-
});
6+
export default defineConfig(({ mode }) => {
7+
const env = loadEnv(mode, process.cwd(), '');
8+
return {
9+
plugins: [sentrySvelteKit({
10+
org: "micropyramid-fa",
11+
project: "bottlecrm-app",
12+
sourceMapsUploadOptions: {
13+
authToken: env.SENTRY_AUTH_TOKEN
14+
},
15+
autoUploadSourceMaps: !!env.PUBLIC_SENTRY_DSN
16+
}), tailwindcss(), sveltekit()],
17+
optimizeDeps: {
18+
exclude: ['esm-env']
19+
}
20+
};
21+
});

0 commit comments

Comments
 (0)