44 lines
1.1 KiB
TypeScript
44 lines
1.1 KiB
TypeScript
import { defineConfig } from "vite";
|
|
import { resolve } from "node:path";
|
|
import { fileURLToPath } from "node:url";
|
|
|
|
const __dirname = resolve(fileURLToPath(import.meta.url), "..");
|
|
|
|
/**
|
|
* Vite 설정 — 임도 설계 웹앱 (Vanilla TS + Three.js)
|
|
*
|
|
* - root: A00_Common (index.html 위치)
|
|
* - 페이지 폴더(A01_Home 등)는 ../를 통해 접근
|
|
* - 0_old(구형 코드), venv(파이썬)는 빌드에서 제외
|
|
*/
|
|
export default defineConfig({
|
|
root: "../A00_Common",
|
|
publicDir: "..",
|
|
resolve: {
|
|
alias: {
|
|
"@ui": resolve(__dirname, "../ui_template"),
|
|
"@config": resolve(__dirname, "./"),
|
|
"@util": resolve(__dirname, "../common_util"),
|
|
},
|
|
},
|
|
server: {
|
|
port: 5173,
|
|
open: true,
|
|
// 백엔드(FastAPI) 프록시 — config_frontend.ts의 API_BASE_URL과 정합
|
|
proxy: {
|
|
"/api": {
|
|
target: "http://localhost:8000",
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
},
|
|
build: {
|
|
outDir: "../node_modules/.build",
|
|
emptyOutDir: true,
|
|
target: "es2022",
|
|
},
|
|
optimizeDeps: {
|
|
exclude: ["0_old"],
|
|
},
|
|
});
|