-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
vite.config.ts
49 lines (46 loc) · 1.23 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
/* eslint-disable import/no-extraneous-dependencies */
/// <reference types="vitest" />
import { defineConfig } from 'vite';
import { fileURLToPath, URL } from 'url';
import vue from '@vitejs/plugin-vue';
import svgIcon from './plugin/svgIcon';
import PWAPlugin from './plugin/pwa';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue(), svgIcon(), PWAPlugin()],
resolve: { alias: { '@': fileURLToPath(new URL('./src', import.meta.url)) } },
build: {
terserOptions: {
compress: {
// Prevent Infinity from being compressed to 1/0, may cause performance issues on Chrome
keep_infinity: true,
drop_console: false,
},
format: { comments: false },
},
minify: 'terser',
// Speed up packing
brotliSize: false,
chunkSizeWarningLimit: 2000,
},
test: {
coverage: {
reporter: ['html', 'lcov'],
all: true,
exclude: [
'node_modules/**',
'dist/**',
'public/**',
'plugin/**',
'test/**',
'.eslintrc.js',
'vite.config.ts',
'**/*.d.ts',
'postcss.config.js',
'tailwind.config.js',
],
},
environment: 'happy-dom',
setupFiles: ['./test/setup.ts'],
},
});