feat: 환경 변수 및 Caddy 라우팅 설정 추가, 게임 API URL 템플릿 지원

This commit is contained in:
2026-07-25 04:32:41 +00:00
parent 976602746c
commit 2824e5af13
11 changed files with 227 additions and 27 deletions
-1
View File
@@ -2,7 +2,6 @@
<html lang="ko">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Sammo HiDCHe - Game</title>
</head>
+1
View File
@@ -7,6 +7,7 @@ declare module '*.vue' {
}
interface ImportMetaEnv {
readonly VITE_APP_BASE_PATH?: string;
readonly VITE_GATEWAY_API_URL?: string;
readonly VITE_GAME_API_URL?: string;
readonly VITE_GAME_SSE_URL?: string;
+26 -10
View File
@@ -1,17 +1,33 @@
import { defineConfig } from 'vite';
import { defineConfig, loadEnv } from 'vite';
import vue from '@vitejs/plugin-vue';
import tailwindcss from '@tailwindcss/vite';
import path from 'path';
const normalizeBasePath = (value: string | undefined): string => {
const pathValue = (value ?? '/').trim();
if (!pathValue || pathValue === '/') {
return '/';
}
return `/${pathValue.replace(/^\/+|\/+$/g, '')}/`;
};
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue(), tailwindcss()],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), '');
return {
base: normalizeBasePath(env.VITE_APP_BASE_PATH),
plugins: [vue(), tailwindcss()],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
},
server: {
port: 3001,
},
server: {
host: '0.0.0.0',
port: 3001,
},
preview: {
host: '0.0.0.0',
},
};
});