-
Notifications
You must be signed in to change notification settings - Fork 501
/
vite.config.ts
62 lines (59 loc) · 1.53 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import { sentrySvelteKit } from '@sentry/sveltekit';
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vitest/config';
import { codecovSvelteKitPlugin } from '@codecov/sveltekit-plugin';
import { loadEnv } from 'vite';
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), '');
return {
plugins: [
sentrySvelteKit({
sourceMapsUploadOptions: {
org: 'syntax-fm',
project: 'website',
authToken: env.SENTRY_AUTH_TOKEN
}
}),
sveltekit(),
codecovSvelteKitPlugin({
enableBundleAnalysis: env.CODECOV_TOKEN !== undefined,
bundleName: 'website',
uploadToken: env.CODECOV_TOKEN
})
],
test: {
include: ['src/**/*.{test,spec}.{js,ts}']
},
css: {
devSourcemap: true,
preprocessorOptions: {
postcss: {
additionalData: `
@custom-media --below-small (width < 400px);
@custom-media --below-med (width < 700px);
@custom-media --below-large (width < 900px);
@custom-media --below-xlarge (width < 1200px);
@custom-media --above-small (width > 400px);
@custom-media --above-med (width > 700px);
@custom-media --above-large (width > 900px);
@custom-media --above-xlarge (width > 1200px);
`
}
}
},
ssr: {
external: ['@sentry/profiling-node']
},
esbuild: {
exclude: '@sentry/profiling-node'
},
resolve: {
alias: {
'.prisma/client/index-browser': './node_modules/@prisma/client/index-browser.js'
}
},
define: {
__VER__: JSON.stringify(env.npm_package_version)
}
};
});