-
Notifications
You must be signed in to change notification settings - Fork 1
/
vite.config.ts
49 lines (47 loc) · 1.62 KB
/
vite.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import path from 'path';
import react from '@vitejs/plugin-react';
import { defineConfig } from 'vitest/config';
export default defineConfig({
plugins: [react()],
resolve: {
alias: [
{ find: '@', replacement: path.resolve(__dirname, './src') },
{
find: '@/components',
replacement: path.resolve(__dirname, './src/components'),
},
{ find: '@/pages', replacement: path.resolve(__dirname, './src/pages') },
{ find: '@/apis', replacement: path.resolve(__dirname, './src/apis') },
{ find: '@/hooks', replacement: path.resolve(__dirname, './src/hooks') },
{ find: '@/store', replacement: path.resolve(__dirname, './src/store') },
{ find: '@/utils', replacement: path.resolve(__dirname, './src/utils') },
{
find: '@/assets',
replacement: path.resolve(__dirname, './src/assets'),
},
{
find: '@/constants',
replacement: path.resolve(__dirname, './src/constants'),
},
{
find: '@/config',
replacement: path.resolve(__dirname, './src/config'),
},
{ find: '@/mocks', replacement: path.resolve(__dirname, './src/mocks') },
{
find: '@/styles',
replacement: path.resolve(__dirname, './src/styles'),
},
],
},
test: {
globals: true,
environment: 'jsdom',
// this points to the setup file
setupFiles: './src/setupTest.ts',
// you might want to disable the `css: true` line, since we don't have
// tests that rely on CSS -- and parsing CSS is slow.
// I'm leaving it in here becasue often people want to parse CSS in tests.
css: true,
},
});