-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
40 lines (37 loc) · 945 Bytes
/
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
import externals from 'rollup-plugin-node-externals';
import { defineConfig } from 'vite';
import { checker } from 'vite-plugin-checker';
import dts from 'vite-plugin-dts';
const TEST_GLOBS = ['**/*.{test|spec}.*', '**/__{tests|mocks}__'];
process.chdir(__dirname);
export default defineConfig({
plugins: [
checker({ typescript: true }),
externals(),
dts({ entryRoot: 'src', logLevel: 'error', exclude: TEST_GLOBS }),
],
build: {
sourcemap: true,
minify: false,
lib: {
entry: 'src/index.ts',
fileName: '[name]',
formats: ['es'],
},
rollupOptions: {
treeshake: false,
output: { preserveModules: true },
},
},
test: {
reporters: ['verbose'],
setupFiles: 'vitest.setup.ts',
coverage: {
enabled: true,
all: true,
reporter: ['html', 'text-summary'],
include: ['**/src/**/*.?(c|m)[jt]s?(x)'],
exclude: TEST_GLOBS,
},
},
});