-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvite.config.ts
More file actions
127 lines (124 loc) ยท 3.31 KB
/
vite.config.ts
File metadata and controls
127 lines (124 loc) ยท 3.31 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
import { defineConfig, loadEnv } from "vite";
import react from "@vitejs/plugin-react";
import svgr from "vite-plugin-svgr";
// import { VitePWA } from "vite-plugin-pwa";
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), "");
const apiBase = env.VITE_API_BASE_URL || "https://banddy.site";
const plugins = [react(), svgr()];
// PWA ์ค์ ์์ ๋นํ์ฑํ (Service Worker 404 ์ค๋ฅ ํด๊ฒฐ์ ์ํด)
// plugins.push(
// VitePWA({
// registerType: "autoUpdate",
// includeAssets: ["favicon.ico", "apple-touch-icon.png", "masked-icon.svg"],
// workbox: {
// globPatterns: ["**/*.{js,css,html,ico,png,svg}"],
// skipWaiting: true,
// clientsClaim: true,
// maximumFileSizeToCacheInBytes: 10 * 1024 * 1024,
// globIgnores: ["**/guitar-boy-*.svg"],
// // Service Worker ํ์ผ๋ช
๋ช
์์ ์ค์
// swDest: "sw.js",
// },
// manifest: {
// name: "Banddy",
// short_name: "Banddy",
// description: "๋ฐด๋ ์์
์ปค๋ฎค๋ํฐ",
// theme_color: "#ffffff",
// background_color: "#121212",
// display: "standalone",
// start_url: "/",
// scope: "/",
// icons: [
// {
// src: "pwa-192x192.png",
// sizes: "192x192",
// type: "image/png",
// },
// {
// src: "pwa-512x512.png",
// sizes: "512x512",
// type: "image/png",
// },
// {
// src: "pwa-512x512.png",
// sizes: "512x512",
// type: "image/png",
// purpose: "any maskable",
// },
// ],
// },
// // Service Worker ๋ฑ๋ก ๋ฐฉ์ ์ค์
// injectRegister: "auto",
// })
// );
return {
plugins,
resolve: {
alias: {
"@": "/src",
},
},
define: {
global: "globalThis",
},
build: {
outDir: "dist",
sourcemap: mode === "development",
rollupOptions: {
output: {
manualChunks: {
vendor: ["react", "react-dom"],
router: ["react-router-dom"],
ui: ["@mui/material", "@emotion/react", "@emotion/styled"],
state: ["valtio", "zustand"],
websocket: ["@stomp/stompjs", "sockjs-client"],
},
},
},
},
server: {
port: 5173,
host: true,
proxy: {
"/api": {
target: apiBase,
changeOrigin: true,
secure: false,
},
"/auth": {
target: apiBase,
changeOrigin: true,
secure: false,
},
"/member": {
target: apiBase,
changeOrigin: true,
secure: false,
},
"/ws": {
target: apiBase,
changeOrigin: true,
ws: true,
secure: false,
},
// ๋ฐฑ์๋๊ฐ ๊ธฐ๋ํ๋ ๊ฒฝ๋ก์ ๋ง์ถฐ ์ถ๊ฐ ํ๋ก์ ์ค์
"/member/login": {
target: apiBase,
changeOrigin: true,
secure: false,
},
"/member/signup": {
target: apiBase,
changeOrigin: true,
secure: false,
},
},
},
preview: {
port: 4173,
host: true,
},
};
});