-
Notifications
You must be signed in to change notification settings - Fork 1
/
vite.config.ts
45 lines (44 loc) · 1.01 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
import { fileURLToPath } from 'node:url';
import { defineConfig } from 'vite';
import { configDefaults } from 'vitest/config';
import dts from 'vite-plugin-dts';
export default defineConfig({
base: './',
plugins: [
dts({
exclude: ['**/**.spec.*', '**/**.test.*', '*.config.*'],
insertTypesEntry: true,
}),
],
worker: {
format: 'es',
},
build: {
lib: {
// Could also be a dictionary or array of multiple entry points
entry: fileURLToPath(new URL('src/main.ts', import.meta.url)),
name: 'imageCompressor',
formats: ['es', 'umd'],
},
},
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
test: {
exclude: [...configDefaults.exclude, './build/**', './dist/**'],
browser: {
enabled: true,
headless: true,
name: 'chrome',
},
coverage: {
reporter: ['default', 'text', 'html'],
extension: ['.ts'],
include: ['src'],
clean: true,
all: true,
},
},
});