Skip to content

Commit 32843ff

Browse files
committed
Manually define __dirname
1 parent ea195e7 commit 32843ff

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
import path from 'node:path';
2+
import { fileURLToPath } from 'node:url';
23
import { defineConfig } from 'vitest/config';
34

5+
// No __dirname under Node ESM
6+
const __filename = fileURLToPath(import.meta.url);
7+
const __dirname = path.dirname(__filename);
8+
49
export default defineConfig({
510
test: {
611
pool: 'typescript',
712
globals: true,
813
setupFiles: ['./test/vitest.setup.ts'],
914
alias: {
10-
'@': path.join(import.meta.dirname, 'test/fixtures'),
11-
'@rtk-query/codegen-openapi': path.join(import.meta.dirname, 'src'),
15+
'@': path.join(__dirname, 'test/fixtures'),
16+
'@rtk-query/codegen-openapi': path.join(__dirname, 'src'),
1217
},
1318
},
1419
});

0 commit comments

Comments
 (0)