Repository navigation
Expand file tree
/
Copy pathvite.config.ts
More file actions
82 lines (77 loc) · 2.08 KB
/
Copy pathvite.config.ts
File metadata and controls
82 lines (77 loc) · 2.08 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
import adapter from '@sveltejs/adapter-vercel';
import preprocess from 'svelte-preprocess';
import postcssPresetEnv from 'postcss-preset-env';
import atImport from 'postcss-import';
import { sentrySvelteKit } from '@sentry/sveltekit/vite';
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vitest/config';
import { codecovSvelteKitPlugin } from '@codecov/sveltekit-plugin';
import { loadEnv } from 'vite';
import { fileURLToPath } from 'node:url';
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), '');
return {
plugins: [
sentrySvelteKit({
org: 'syntax-fm',
project: 'website',
authToken: env.SENTRY_AUTH_TOKEN
}),
sveltekit({
preprocess: [
preprocess({
postcss: {
prependData: `
@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);
@custom-media --stacked-video-bar (max-width: 809px);
`,
plugins: [
atImport,
postcssPresetEnv({
stage: 2,
features: {
'nesting-rules': true,
'custom-media-queries': true,
'media-query-ranges': true
}
})
]
}
})
],
adapter: adapter({ runtime: 'nodejs22.x' })
}),
codecovSvelteKitPlugin({
enableBundleAnalysis: env.CODECOV_TOKEN !== undefined,
bundleName: 'website',
uploadToken: env.CODECOV_TOKEN
})
],
test: {
include: ['src/**/*.{test,spec}.{js,ts}']
},
css: {
devSourcemap: true
},
ssr: {
external: ['@sentry/profiling-node']
},
resolve: {
alias: {
'.prisma/client/index-browser': fileURLToPath(
new URL('./node_modules/@prisma/client/index-browser.js', import.meta.url)
)
}
},
define: {
__VER__: JSON.stringify(env.npm_package_version)
}
};
});