Imported as a linear vendor commit so forge rebases do not replay the upstream root tree. git-subtree-dir: third_party/pi git-subtree-split: d981de1229ef899957bbe968bc8dcda02a21f477
29 lines
1.2 KiB
TypeScript
29 lines
1.2 KiB
TypeScript
import { fileURLToPath } from "node:url";
|
|
import { defineConfig } from "vitest/config";
|
|
|
|
const src = (path: string): string => fileURLToPath(new URL(path, import.meta.url));
|
|
|
|
/**
|
|
* Exact matches for bare specifiers, plus one rule per package for subpath exports such as
|
|
* `@earendil-works/pi-ai/utils/uuid`. A prefix alias would rewrite those onto `index.ts/utils/uuid`.
|
|
*/
|
|
export default defineConfig({
|
|
test: {
|
|
globals: true,
|
|
environment: "node",
|
|
reporters: process.env.GITHUB_ACTIONS ? ["dot", "github-actions"] : ["dot"],
|
|
},
|
|
resolve: {
|
|
conditions: ["source"],
|
|
alias: [
|
|
{ find: /^@earendil-works\/pi-agent-core$/, replacement: src("../agent/src/index.ts") },
|
|
{ find: /^@earendil-works\/pi-agent-core\/(.+)$/, replacement: `${src("../agent/src/")}$1.ts` },
|
|
{ find: /^@earendil-works\/pi-ai$/, replacement: src("../ai/src/index.ts") },
|
|
{ find: /^@earendil-works\/pi-ai\/(.+)$/, replacement: `${src("../ai/src/")}$1.ts` },
|
|
{ find: /^@earendil-works\/pi-telemetry$/, replacement: src("../telemetry/src/index.ts") },
|
|
{ find: /^@earendil-works\/pi-protocol$/, replacement: src("../protocol/src/index.ts") },
|
|
],
|
|
},
|
|
ssr: { resolve: { conditions: ["source"] } },
|
|
});
|