-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathvite.config.ts
45 lines (43 loc) · 1.32 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
/// <reference types="vitest" />
/// <reference types="vite/client" />
import path from 'path'
import react from '@vitejs/plugin-react-swc'
import { defineConfig } from 'vite'
import svgr from 'vite-plugin-svgr'
const projectRoot = path.resolve(__dirname)
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react(), svgr({ exportAsDefault: true })],
test: {
globals: true,
environment: 'jsdom',
setupFiles: [path.resolve(projectRoot, 'src/tests/setup.ts')],
css: true,
},
define: {
global: 'window',
},
server: {
port: 3000,
proxy: {
// '/api': 'http://backend-api:3011', // backend-api is production
'/api': 'http://localhost:3011', // localhost is for dev
},
},
preview: {
port: 3000,
},
resolve: {
alias: {
components: path.resolve(projectRoot, 'src/components/common/'),
constants: path.resolve(projectRoot, 'src/constants/'),
hooks: path.resolve(projectRoot, 'src/hooks/'),
assets: path.resolve(projectRoot, 'src/assets/'),
pages: path.resolve(projectRoot, 'src/pages/'),
services: path.resolve(projectRoot, 'src/services/'),
styles: path.resolve(projectRoot, 'src/styles/'),
utils: path.resolve(projectRoot, 'src/utils/'),
contracts: path.resolve(projectRoot, 'src/contracts/'),
},
},
})