-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.ts
More file actions
28 lines (26 loc) · 1.14 KB
/
Copy pathvitest.config.ts
File metadata and controls
28 lines (26 loc) · 1.14 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
import { readFileSync } from 'node:fs'
import { fileURLToPath } from 'node:url'
import { defineConfig } from 'vitest/config'
/** 与 tsdown 同源:包名既是模块表的键,也是 <style data-plugin> 的标记。 */
const PLUGIN_ID: string = JSON.parse(readFileSync('package.json', 'utf8')).name
export default defineConfig({
define: { __PLUGIN_ID__: JSON.stringify(PLUGIN_ID) },
resolve: {
alias: {
// 构建期由 tsdown 注入的虚拟模块;测试用空产物桩。
'virtual:tailwind-css': fileURLToPath(new URL('./tests/stubs/virtual-tailwind-css.ts', import.meta.url)),
// 平台模块:构建期 external,测试里桩掉——见 tests/stubs/ui-primitives.tsx。
'@deepseek-ai/dsh-client-ui-primitives': fileURLToPath(new URL('./tests/stubs/ui-primitives.tsx', import.meta.url)),
},
},
test: {
include: ['tests/**/*.spec.ts', 'tests/**/*.spec.tsx'],
environment: 'node',
server: {
deps: {
// client 组件树会 import dsh 浏览器包(内含 CSS module),交给 vite 管线处理而非 node 原生加载。
inline: [/@deepseek-ai\/dsh-client-/],
},
},
},
})