-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
37 lines (36 loc) · 970 Bytes
/
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
// vite.config.ts
import { resolve } from 'node:path'
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react-swc'
import unocss from 'unocss/vite'
export default defineConfig({
// SCSS 전역 사용
css: {
devSourcemap: true,
preprocessorOptions: {
scss: {
additionalData: '@import "~/assets/styles/_variables";'
}
}
},
plugins: [
react(),
unocss()
],
server: {
port: 3333,
proxy: {
'/mock': {
target: 'http://localhost:3001', // json-server로 만들어진 mockup api 서버를 가르킴
changeOrigin: true,
rewrite: path => path.replace(/^\/mock/, '') // json-server를 사용할 수 있게 /mock을 제거
}
// TODO: API 서버가 만들어질 경우 Proxy 설정을 추가해주세요. (참고: https://vitejs.dev/config/server-options.html#server-proxy)
}
},
resolve: {
alias: {
'~': resolve(__dirname, 'src')
}
}
})