-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathvite.config.mts
56 lines (54 loc) · 1.14 KB
/
vite.config.mts
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
50
51
52
53
54
55
56
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import svgrPlugin from 'vite-plugin-svgr'
import tsconfigPaths from 'vite-tsconfig-paths'
import eslintPlugin from 'vite-plugin-eslint'
import path from 'path'
export default defineConfig({
plugins: [
react(),
svgrPlugin(),
tsconfigPaths(),
eslintPlugin({
cache: true,
failOnError: false
})
],
server: {
port: 3000,
open: true,
host: true,
proxy: {
'/api': {
target: 'http://localhost:8080',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, '')
},
'/socket.io': {
target: 'ws://localhost:8080',
ws: true
}
}
},
esbuild: {
loader: 'tsx'
},
css: {
preprocessorOptions: {
scss: {
api: 'modern-compiler'
}
}
},
resolve: {
alias: {
'~': path.resolve(__dirname, 'src/'),
'~tests': path.resolve(__dirname, 'tests/'),
'~scss': path.resolve(__dirname, 'src/design-system/scss/'),
'~scss-components': path.resolve(
__dirname,
'src/design-system/components/'
)
}
}
})