first commit

This commit is contained in:
2026-11-10 10:12:09 +09:00
commit 0288412bbb
84 changed files with 312187 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
import { createSSRApp, createApp } from 'vue';
import App from './App.vue';
import { createAppRouter } from './router';
// 서버(사전 렌더링)와 브라우저가 공유하는 앱 팩토리
export function createPickApp({ ssr = false } = {}) {
const isBrowser = !ssr && typeof window !== 'undefined';
// 브라우저에서 #app 내에 사전 렌더링된 실제 DOM 요소가 있을 때만 hydrate(createSSRApp), 없으면 클린 마운트(createApp)
const hasSsrMarkup = isBrowser && !!document.querySelector('#app')?.firstElementChild;
const shouldUseSSR = ssr || hasSsrMarkup;
const app = shouldUseSSR ? createSSRApp(App) : createApp(App);
const router = createAppRouter({ ssr });
app.use(router);
return { app, router };
}