-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
37 lines (34 loc) · 890 Bytes
/
vite.config.ts
File metadata and controls
37 lines (34 loc) · 890 Bytes
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
import { defineConfig, loadEnv } from 'vite';
import react from '@vitejs/plugin-react-swc';
import path from 'path';
import tailwindcss from 'tailwindcss';
import autoprefixer from 'autoprefixer';
// https://vite.dev/config/
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd());
const API_BASE_URL = `${env.VITE_API_BASE_URL ?? 'http://api.gotogether.io.kr:8081'}`;
return {
plugins: [react()],
css: {
postcss: {
plugins: [tailwindcss(), autoprefixer()],
},
},
server: {
host: true,
allowedHosts: ['gotogether.io.kr'],
proxy: {
'/api/v1': {
target: API_BASE_URL,
changeOrigin: true,
rewrite: path => path.replace(/^\/api/, ''),
},
},
},
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
};
});