-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathvite.config.ts
More file actions
61 lines (60 loc) · 1.59 KB
/
Copy pathvite.config.ts
File metadata and controls
61 lines (60 loc) · 1.59 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
import path from 'node:path'
import tailwindcss from '@tailwindcss/vite'
import react from '@vitejs/plugin-react'
import { defineConfig } from 'vite'
export default defineConfig({
plugins: [react(), tailwindcss()],
// Fallbacks ('dev'/'local') must stay in sync with src/version.ts.
define: {
'process.env.DIGARR_GIT_SHA': JSON.stringify(process.env.DIGARR_GIT_SHA ?? 'dev'),
'process.env.DIGARR_CHANNEL': JSON.stringify(process.env.DIGARR_CHANNEL ?? 'local'),
},
resolve: {
alias: { '@': path.resolve(__dirname, './src') },
},
root: '.',
build: {
outDir: 'dist/web',
emptyOutDir: true,
rollupOptions: {
input: {
app: path.resolve(__dirname, 'index.html'),
spotifyBridge: path.resolve(__dirname, 'spotify-embed-bridge.html'),
},
},
},
server: {
proxy: {
'/api': 'http://localhost:3000',
'/health': 'http://localhost:3000',
},
},
test: {
globals: true,
environment: 'node',
setupFiles: ['./tests/setup.ts'],
include: ['tests/**/*.test.{ts,tsx}'],
alias: { '@': path.resolve(__dirname, './src') },
coverage: {
provider: 'v8',
reporter: ['text', 'html', 'json-summary'],
include: ['src/**/*.{ts,tsx}'],
exclude: [
'src/web/**/*.tsx',
'src/index.ts',
'src/**/types.ts',
'src/**/*.d.ts',
'src/core/i18n/messages/**',
'src/db/schema.ts',
'src/server/openapi.ts',
'drizzle/**',
],
thresholds: {
lines: 80,
functions: 75,
branches: 65,
statements: 78,
},
},
},
})