Files
oxc-project__oxc/tasks/e2e/vitest.config.ts
Boshen 1d680de87e chore(pnpm): remove tasks/e2e workspace (#16881)
I thought making it a separate would be easier to manage,
but it's actually not.

Previous setup was also downloading packages from npm on every CI run.
2025-12-16 14:03:25 +00:00

43 lines
927 B
TypeScript

import { readFileSync } from "node:fs";
import { transformSync } from "oxc-transform";
import { defineConfig } from "vitest/config";
export default defineConfig({
test: {
globals: true,
root: "./",
},
plugins: [
{
name: "oxc",
async load(id) {
if (!id.endsWith(".ts")) {
return;
}
if (!id.includes("nestjs")) {
return;
}
// Use oxc-transform to transform TypeScript files
const resolved = await this.resolve(id);
if (!resolved) {
return;
}
const code = readFileSync(resolved.id).toString();
const result = transformSync(id, code, {
target: "es2020",
decorator: {
legacy: true,
emitDecoratorMetadata: true,
},
});
return {
code: result.code,
map: result.map,
};
},
},
],
});