-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvite.config.js
52 lines (47 loc) · 1.38 KB
/
vite.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import { defineConfig, loadEnv } from 'vite';
import { sveltekit } from '@sveltejs/kit/vite';
import { sentrySvelteKit } from '@sentry/sveltekit';
import pkg from './package.json';
const config = ({ mode }) => {
process.env = { ...process.env, ...loadEnv(mode, process.cwd(), '') };
const sentryConfig = {
sourceMapsUploadOptions: {
org: 'that-conference',
project: 'thatconference-com',
release: pkg.version,
authToken: process.env.SENTRY_SRC_MAP_UPLOAD,
url: 'https://sentry.io',
cleanArtifacts: true,
rewrite: false,
// vite overrides NODE_ENV to production when running 'vite build'
uploadSourceMaps: process.env.PUBLIC_VERCEL_ENV === 'production',
deploy: {
env: 'production'
},
setCommits: {
auto: true,
ignoreMissing: true
},
sourceMaps: {
assets: ['./.svelte-kit/output'],
ignore: ['node_modules']
},
debug: false,
dryRun: false
}
};
return defineConfig({
plugins: [sentrySvelteKit(sentryConfig), sveltekit()],
build: {
sourcemap: true
},
test: {
include: ['src/**/*.{test,spec}.{js,ts}']
}
});
};
export default config;
// Sentry vite plugin reference:
// https://github.com/getsentry/sentry-javascript-bundler-plugins/tree/259018857f1fd58b29a8fa92fa573953a9c30fca/packages/vite-plugin
// sentry's vite plugin based on v0.61 per support ticket
// https://www.npmjs.com/package/@sentry/vite-plugin/v/0.6.1