-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvite.config.ts
More file actions
49 lines (45 loc) · 1.4 KB
/
vite.config.ts
File metadata and controls
49 lines (45 loc) · 1.4 KB
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 'node:path';
import tailwindcss from '@tailwindcss/vite';
import react from '@vitejs/plugin-react-swc';
import { loadEnv } from 'vite';
import type { ConfigEnv } from 'vite';
import { defineConfig } from 'vitest/config';
const viteConfig = ({ mode }: ConfigEnv) => {
const env = loadEnv(mode, process.cwd(), 'VITE_');
return defineConfig({
plugins: [react(), tailwindcss()],
server: {
proxy: {
'/api': {
target: env.VITE_API_URL,
changeOrigin: true,
secure: false,
},
},
},
resolve: {
alias: {
'@components': path.resolve(__dirname, 'src/shared/components'),
'@services': path.resolve(__dirname, 'src/shared/services'),
'@hooks': path.resolve(__dirname, 'src/shared/hooks'),
'@styles': path.resolve(__dirname, 'src/shared/styles'),
'@assets': path.resolve(__dirname, 'src/assets'),
'@types': path.resolve(__dirname, 'src/shared/types'),
'@shared': path.resolve(__dirname, 'src/shared'),
},
},
test: {
include: ['**/*.test.tsx'],
globals: true,
setupFiles: './src/setupTests.ts',
environment: 'jsdom',
coverage: {
provider: 'v8',
reporter: ['text', 'html', 'lcov'],
reportsDirectory: './coverage',
exclude: ['node_modules/', 'src/main.tsx'],
},
},
});
};
export default viteConfig;