Add sentry auth token to vite

This commit is contained in:
Rotimi Best
2023-08-13 09:17:36 +01:00
parent 03c7998ce0
commit 0ba6e92b0b
3 changed files with 38 additions and 9 deletions
+20 -8
View File
@@ -1,10 +1,22 @@
import { sentryVitePlugin } from "@sentry/vite-plugin";
import { sentryVitePlugin } from '@sentry/vite-plugin';
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';
import { defineConfig, loadEnv } from 'vite';
export default defineConfig({
plugins: [sveltekit(), sentryVitePlugin({
org: "the-next-greats",
project: "classroomio"
})],
});
export default ({ mode }) => {
process.env = { ...process.env, ...loadEnv(mode, process.cwd()) };
return defineConfig({
plugins: [
sveltekit(),
sentryVitePlugin({
url: 'https://sentry.io',
authToken: process.env.VITE_SENTRY_AUTH_TOKEN,
org: 'the-next-greats',
project: 'classroomio'
})
],
build: {
sourcemap: true
}
});
};