-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvite.config.ts
44 lines (40 loc) · 1.19 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
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import svgr from "vite-plugin-svgr";
import path from "path";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [svgr(), react()],
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
build: {
rollupOptions: {
output: {
assetFileNames: ({ name }) => {
if (/\.(gif|jpe?g|png|svg)$/.test(name ?? "")) {
return "assets/images/[name]-[hash][extname]";
}
if (/\.css$/.test(name ?? "")) {
return "assets/css/[name]-[hash][extname]";
}
if (/\.(ttf|otf|woff|woff2|eot)$/.test(name ?? "")) {
return "assets/fonts/[name]-[hash][extname]";
}
return "assets/[name]-[hash][extname]";
},
},
},
},
// server: {
// proxy: {
// "/api": {
// target: "http://api.canvas-diary.kro.kr", // 프록시할 서버 주소
// changeOrigin: true, // 필요에 따라 원본의 호스트 헤더를 변경
// rewrite: (path) => path.replace(/^\/api/, ""), // 요청 경로에서 '/api'를 제거
// },
// },
// },
});