|
1 | | -import { defineConfig } from 'vitest/config' |
2 | | - |
3 | 1 | import path from 'node:path' |
4 | 2 | import { fileURLToPath } from 'node:url' |
| 3 | +import tsconfigPaths from 'vite-tsconfig-paths' |
| 4 | +import { defineConfig } from 'vitest/config' |
5 | 5 |
|
6 | 6 | // No __dirname under Node ESM |
7 | 7 | const __filename = fileURLToPath(import.meta.url) |
8 | 8 | const __dirname = path.dirname(__filename) |
9 | 9 |
|
10 | 10 | export default defineConfig({ |
| 11 | + plugins: [tsconfigPaths({ root: import.meta.dirname })], |
11 | 12 | test: { |
12 | 13 | globals: true, |
13 | 14 | environment: 'jsdom', |
14 | 15 | setupFiles: ['./vitest.setup.ts'], |
15 | 16 | include: ['./src/**/*.(spec|test).[jt]s?(x)'], |
16 | | - alias: { |
17 | | - // prettier-ignore |
18 | | - '@reduxjs/toolkit/query/react': path.join(__dirname,'./src/query/react/index.ts'), // @remap-prod-remove-line |
19 | | - '@reduxjs/toolkit/query': path.join(__dirname, './src/query/index.ts'), // @remap-prod-remove-line |
20 | | - '@reduxjs/toolkit/react': path.join(__dirname, './src/index.ts'), // @remap-prod-remove-line |
21 | | - '@reduxjs/toolkit': path.join(__dirname, './src/index.ts'), // @remap-prod-remove-line |
22 | | - |
23 | | - // this mapping is disabled as we want `dist` imports in the tests only to be used for "type-only" imports which don't play a role for jest |
24 | | - //'^@reduxjs/toolkit/dist/(.*)$': '<rootDir>/src/*', |
25 | | - '@internal': path.join(__dirname, './src'), |
26 | | - }, |
27 | 17 | server: { deps: { inline: ['redux', '@reduxjs/toolkit'] } }, |
28 | 18 | }, |
29 | 19 | }) |
0 commit comments