-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathvitest.config.ts
More file actions
105 lines (102 loc) · 3.4 KB
/
Copy pathvitest.config.ts
File metadata and controls
105 lines (102 loc) · 3.4 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
import path from "node:path";
import { fileURLToPath } from "node:url";
import { defineConfig } from "vitest/config";
const rootDir = path.dirname(fileURLToPath(import.meta.url));
const coreSource = (folder: string) =>
path.resolve(rootDir, "packages/core/src", folder);
const webSource = (folder: string) =>
path.resolve(rootDir, "packages/web/src", folder);
export default defineConfig({
resolve: {
alias: [
{
find: "supervision/editing",
replacement: path.resolve(rootDir, "packages/web/src/editing.ts"),
},
{
find: "supervision",
replacement: path.resolve(rootDir, "packages/web/src/index.ts"),
},
{
find: "supervision-js-core",
replacement: path.resolve(rootDir, "packages/core/src/index.ts"),
},
{
find: /^#detections\/(array-detection-frame-source|buffered-detection-timeline|cold-detection-frame-source|composite-detection-frame-source|editable-annotation-frame-session|memory-cold-detection-frame-store|projected-detection-frame-source|writable-detection-frame-source)$/,
replacement: `${coreSource("detections")}/$1.ts`,
},
{
find: /^#interactions\/(.+)$/,
replacement: `${coreSource("interactions")}/$1.ts`,
},
{
find: /^#post-processing\/(byte-track-tracker|cbiou-tracker|oc-sort-tracker|sort-tracker|tracking|tracking-association|tracking-kalman)$/,
replacement: `${coreSource("post-processing")}/$1.ts`,
},
{
find: /^#styles\/(.+)$/,
replacement: `${coreSource("styles")}/$1.ts`,
},
{
find: /^#types\/(annotation-renderer|box-style|detection-timeline|detections|editing|ellipse-style|focus-style|interaction|interaction-style|keypoint-style|label-style|mask-style|media|media-rendering|paint-style|polygon-style|polyline-style|post-processing|session-lifecycle|shape-style|style|viewport)$/,
replacement: `${coreSource("types")}/$1.ts`,
},
{
find: /^#utils\/(.+)$/,
replacement: `${coreSource("utils")}/$1.ts`,
},
{
find: /^#constants\/(.+)$/,
replacement: `${webSource("constants")}/$1.ts`,
},
{
find: /^#detections\/(.+)$/,
replacement: `${webSource("detections")}/$1.ts`,
},
{
find: /^#editing\/(.+)$/,
replacement: `${webSource("editing")}/$1.ts`,
},
{
find: /^#media\/(.+)$/,
replacement: `${webSource("media")}/$1.ts`,
},
{
find: /^#playback\/(.+)$/,
replacement: `${webSource("playback")}/$1.ts`,
},
{
find: /^#post-processing\/(.+)$/,
replacement: `${webSource("post-processing")}/$1.ts`,
},
{
find: /^#render-preparation\/(.+)$/,
replacement: `${webSource("render-preparation")}/$1.ts`,
},
{
find: /^#renderers\/(.+)$/,
replacement: `${webSource("renderers")}/$1.ts`,
},
{
find: /^#sessions\/(.+)$/,
replacement: `${webSource("sessions")}/$1.ts`,
},
{
find: /^#types\/(.+)$/,
replacement: `${webSource("types")}/$1.ts`,
},
{
find: /^#workers\/(.+)$/,
replacement: `${webSource("workers")}/$1.ts`,
},
],
},
test: {
environment: "node",
include: [
"packages/**/*.test.ts",
"demo/src/**/*.test.ts",
"examples/react-native/src/**/*.test.ts",
],
},
});