-
Notifications
You must be signed in to change notification settings - Fork 1
/
vite.config.ts
62 lines (61 loc) · 1.76 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 { defineConfig } from 'vite'
import { svelte } from '@sveltejs/vite-plugin-svelte'
import { svelteTesting } from '@testing-library/svelte/vite'
import { resolve } from 'path'
import webpackStatsPlugin from 'rollup-plugin-webpack-stats'
import { sentryVitePlugin } from '@sentry/vite-plugin'
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => {
return {
base: './',
plugins: [
svelte({}),
svelteTesting(),
webpackStatsPlugin(),
sentryVitePlugin({
org: 'kikos0',
project: 'dbd-tooltips',
authToken: process.env.SENTRY_AUTH_TOKEN,
telemetry: false
})
],
envDir: './env',
esbuild: {
pure:
mode === 'production'
? ['console.log', 'console.info', 'console.warn', 'console.trace']
: undefined,
drop: mode === 'production' ? ['console', 'debugger'] : ['debugger']
},
build: {
sourcemap: mode !== 'development' ? 'hidden' : true,
rollupOptions: {
input: {
web: resolve(__dirname, 'video_overlay.html'),
mobile: resolve(__dirname, 'mobile.html'),
config: resolve(__dirname, 'config.html')
},
output: {
assetFileNames: 'assets/[name].[hash][extname]',
chunkFileNames: 'assets/[name].[hash].js',
entryFileNames: 'assets/[name].[hash].js'
}
}
},
test: {
include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
environment: 'happy-dom',
alias: [
{
find: '@testing-library/svelte',
replacement: '@testing-library/svelte/svelte5'
}
],
setupFiles: ['./vitest-setup.ts'],
coverage: {
provider: 'v8',
include: ['src/**']
}
}
}
})