diff --git a/.gitignore b/.gitignore index 88a7a4f..db75880 100644 --- a/.gitignore +++ b/.gitignore @@ -91,3 +91,5 @@ test-results/ # Vercel 폴더 예외 처리 !.vercel/ +.vercel +.env*.local diff --git a/vercel.json b/vercel.json index d495f4e..d779e75 100644 --- a/vercel.json +++ b/vercel.json @@ -2,7 +2,11 @@ "rewrites": [ { "source": "/api/:path*", - "destination": "/api/:path*" + "destination": "${env:VITE_BASE_URL}/api/:path*" + }, + { + "source": "/(.*)", + "destination": "/" } ] } \ No newline at end of file diff --git a/vite.config.js b/vite.config.js index 04cde9a..1a258f5 100644 --- a/vite.config.js +++ b/vite.config.js @@ -46,6 +46,13 @@ export default defineConfig({ } }) ], + build: { + rollupOptions: { + input: { + main: path.resolve(__dirname, "index.html") + } + } + }, server: process.env.NODE_ENV === 'development' ? { https: { key: fs.readFileSync(path.resolve(__dirname, 'localhost-key.pem')), @@ -53,12 +60,20 @@ export default defineConfig({ }, proxy: { "/api": { - target: process.env.VITE_BASE_URL, + target: process.env.VITE_BASE_URL || import.meta.env.VITE_BASE_URL, + changeOrigin: true, + secure: false, // HTTPS 강제 변환 방지 + } + }, + } : { + proxy: { + "/api": { + target: process.env.VITE_BASE_URL || import.meta.env.VITE_BASE_URL, changeOrigin: true, secure: false, // HTTPS 강제 변환 방지 - }, + } }, - } : {}, + }, resolve: { alias: { '@atoms': path.resolve(__dirname, 'src/atoms'),