/** * Vitest config: inline the npm-published `@deepseek-ai/*` packages whose * BUILT lib bundles css side-effect imports (e.g. `dsh-client-ui-primitives` * imports `katex/dist/katex.min.css` at the top of its `lib/index.js`). * * Installed from the npm registry (the default since v0.4.1) these packages * live under `node_modules/.pnpm` and are externalized by vitest — Node then * chokes on the `.css` import. Inlining routes them through Vite's transform, * which stubs css imports (the default `css: false`). The previous * `link:`-to-source-checkout install needed no such config: linked files sit * outside `node_modules` and are transformed by default. */ import { defineConfig } from 'vitest/config' export default defineConfig({ test: { server: { deps: { inline: [/@deepseek-ai\/dsh-client-ui-primitives/], }, }, // The Playwright headless-render lane lives in tests/e2e (specs named // *.e2e.ts). Keep vitest from ever collecting it, both by naming (the // default include only matches *.test.* / *.spec.*) and by an explicit // exclude. NOTE: `exclude` REPLACES vitest's defaults, so the standard // node_modules/dist/etc. excludes must be restated here. exclude: [ 'tests/e2e/**', // Local dev worktrees (pnpm/DSH-style task branches) may carry stale // code against this checkout's node_modules — never collect them. '**/.worktrees/**', '**/node_modules/**', '**/dist/**', '**/cypress/**', '**/.{idea,git,cache,output,temp}/**', '**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build,eslint,prettier}.config.*', ], }, })