Repository navigation
Expand file tree
/
Copy pathvitest.shared.mts
More file actions
66 lines (63 loc) · 1.47 KB
/
Copy pathvitest.shared.mts
File metadata and controls
66 lines (63 loc) · 1.47 KB
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
63
64
65
66
import { join } from "node:path"
import swc from "unplugin-swc"
import tsconfigPaths from "vite-tsconfig-paths"
import { defineConfig } from "vitest/config"
export const root = import.meta.dirname
export default defineConfig({
test: {
globals: true,
environment: "node",
coverage: {
enabled: true,
reporter: ["text", "json", "html"],
include: ["src/**/*.{tsx,ts}"],
exclude: [
"**/node_modules/**",
"**/@tsed/**",
"**/exports.ts",
"**/interfaces/**",
"**/*fixtures.ts",
"**/fixtures/**",
"**/__fixtures__/**",
"**/*.spec.{ts,tsx}",
"**/*.stories.{ts,tsx}",
"**/*.d.ts",
"**/__mocks__/**",
"**/__mock__/**",
"**/tests/**",
"**/index.ts"
]
}
},
plugins: [
tsconfigPaths({
projects: [join(root, "tsconfig.json"), join(root, "tsconfig.spec.json")]
}),
swc.vite({
sourceMaps: true,
inlineSourcesContent: true,
jsc: {
target: "esnext",
externalHelpers: true,
keepClassNames: true,
parser: {
syntax: "typescript",
tsx: true,
decorators: true
},
transform: {
useDefineForClassFields: false,
legacyDecorator: true,
decoratorMetadata: true
}
},
module: {
type: "es6",
strictMode: true,
lazy: false
},
minify: false,
isModule: true
})
]
})