-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.ts
More file actions
51 lines (50 loc) · 1.44 KB
/
Copy pathvitest.config.ts
File metadata and controls
51 lines (50 loc) · 1.44 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
import { defineConfig } from 'vitest/config'
import swc from 'unplugin-swc'
import path from 'node:path'
export default defineConfig({
plugins: [
swc.vite({
jsc: {
parser: { syntax: 'typescript', decorators: true },
transform: { legacyDecorator: true, decoratorMetadata: true },
},
}),
],
resolve: {
alias: [
// Anchored regex aliases — string `find` does prefix matching,
// which rewrites `/bus/token` into `bus.ts/token` (ENOTDIR).
// Order still matters: longest subpath first.
{
find: /^@forinda\/kickjs-devtools-kit\/bus\/token$/,
replacement: path.resolve(__dirname, '../devtools-kit/src/bus/token.ts'),
},
{
find: /^@forinda\/kickjs-devtools-kit\/bus$/,
replacement: path.resolve(__dirname, '../devtools-kit/src/bus.ts'),
},
{
find: /^@forinda\/kickjs-devtools-kit$/,
replacement: path.resolve(__dirname, '../devtools-kit/src/index.ts'),
},
{
find: /^@forinda\/kickjs$/,
replacement: path.resolve(__dirname, '../kickjs/src/index.ts'),
},
{
find: /^@forinda\/kickjs-devtools$/,
replacement: path.resolve(__dirname, 'src/index.ts'),
},
],
},
test: {
typecheck: {
tsconfig: './tsconfig.test.json',
},
environment: 'node',
include: ['__tests__/**/*.test.ts'],
globals: false,
pool: 'threads',
maxConcurrency: 1,
},
})