-
Notifications
You must be signed in to change notification settings - Fork 4
/
vite.config.js
62 lines (57 loc) · 1.66 KB
/
vite.config.js
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
57
58
59
60
61
62
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react-swc'
// import { resolve } from 'path';
// import { fileURLToPath } from 'url';
// const __dirname = fileURLToPath(new URL('.', import.meta.url));
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
react(),
],
css: {
preprocessorOptions: {
scss: {
additionalData: `@import "@styles/common/variables.scss"; @import "@styles/common/mixins.scss";`,
},
},
},
resolve: {
alias: [
{ find: "@", replacement: "/src" },
{ find: "@api", replacement: "/src/api" },
{ find: "@assets", replacement: "/src/assets" },
{ find: "@components", replacement: "/src/components" },
{ find: "@hooks", replacement: "/src/hooks" },
{ find: "@layouts", replacement: "/src/layouts" },
{ find: "@pages", replacement: "/src/pages" },
{ find: "@router", replacement: "/src/router" },
{ find: "@styles", replacement: "/src/styles" },
{ find: "@utils", replacement: "/src/utils" },
{ find: "@zustand", replacement: "/src/zustand" },
],
},
// build: {
// babel: {
// configFile: path.resolve(__dirname, './babel.config.json')
// }
// },
server: {
port: 3000,
proxy: {
'/api/': {
target: 'http://localhost:8080/api/',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, '')
},
'/socket': {
target: 'http://localhost:5000/api',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/socket/, '')
}
},
// cors: {
// origin: 'http://localhost:8080',
// credentials: true,
// }
}
})