-
Notifications
You must be signed in to change notification settings - Fork 52
/
vite.config.ts
36 lines (34 loc) · 1020 Bytes
/
vite.config.ts
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
import { loadEnv } from 'vite';
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vitest/config';
import mkcert from 'vite-plugin-mkcert';
import { sentrySvelteKit } from '@sentry/sveltekit';
const env = loadEnv('development', process.cwd());
const HTTPS_ENABLED = env.VITE_HTTPS_ENABLED === 'true';
const extraPlugins = HTTPS_ENABLED ? [mkcert()] : [];
export default defineConfig({
plugins: [
sveltekit(),
sentrySvelteKit({
sourceMapsUploadOptions: {
org: 'significa',
project: 'significa-website'
}
}),
...extraPlugins
],
test: {
include: ['src/**/*.{test,spec}.{js,ts}']
},
server: {
https: HTTPS_ENABLED,
fs: {
// allow root path to allow including fonts.
// useful when developing locally with linked UI library.
allow: process.env.NODE_ENV === 'development' ? ['/'] : undefined
}
},
optimizeDeps: {
exclude: process.env.NODE_ENV === 'development' ? ['@significa/svelte-ui'] : []
}
});