-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
vite.config.ts
48 lines (44 loc) · 1.31 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
import { resolve } from 'path';
import dts from 'vite-plugin-dts';
import { defineConfig } from 'vitest/config';
// eslint-disable-next-line no-restricted-exports
export default defineConfig({
// @ts-expect-error Error caused by vitest using vite 5 and the root using vite 6. To be fixed in vitest 3.
plugins: [dts({ rollupTypes: true })],
build: {
lib: {
entry: {
index: resolve(__dirname, 'src/index.ts'),
'api-contract': resolve(__dirname, 'src/api-contract/index.ts'),
browser: resolve(__dirname, 'src/browser/index.ts'),
node: resolve(__dirname, 'src/node/index.ts'),
},
},
rollupOptions: {
// Keep references to these node dependencies, but don't try to bundle them
external: ['node:http', 'node:https'],
},
},
test: {
environment: 'jsdom',
globals: true,
setupFiles: './test/setup.ts',
coverage: {
provider: 'v8',
reportsDirectory: './coverage',
include: [
'src/**/*.ts',
'!src/index.ts',
'!src/api-contract/*',
],
reporter: ['text', 'text-summary', 'clover', 'html'],
// Required code coverage. Lower than this will make the check fail
thresholds: {
statements: 95,
branches: 95,
functions: 95,
lines: 95,
},
},
},
});