Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,21 @@
href="https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap"
rel="stylesheet"
/>
<style>
/* 웹폰트 로딩 최적화 */
@font-face {
font-family: 'Press Start 2P';
font-display: swap;
font-weight: 400;
font-style: normal;
}

/* 폰트 로딩 중 fallback 설정 */
.font-press-start {
font-family: 'Press Start 2P', 'Courier New', monospace;
font-display: swap;
}
</style>
<title>Pick-Px</title>
</head>
<body>
Expand Down
165 changes: 164 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"socket.io-client": "^4.8.1",
"tailwindcss": "^4.1.11",
"use-sound": "^5.0.0",
"web-vitals": "^5.1.0",
"zustand": "^5.0.6"
},
"devDependencies": {
Expand All @@ -49,6 +50,8 @@
"typescript": "~5.8.3",
"typescript-eslint": "^8.34.1",
"vite": "^7.0.0",
"vitest": "^3.2.4"
"vite-bundle-analyzer": "^1.2.3",
"vitest": "^3.2.4",
"webpack-bundle-analyzer": "^4.10.2"
}
}
14 changes: 14 additions & 0 deletions src/index.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
@import 'tailwindcss';

/* 웹폰트 최적화 */
@font-face {
font-family: 'Press Start 2P';
font-display: swap;
font-weight: 400;
font-style: normal;
}

/* 폰트 로딩 중 텍스트 표시 최적화 */
.font-press-start {
font-family: 'Press Start 2P', 'Courier New', monospace;
font-display: swap;
}
html,
body {
overflow: hidden; /* 스크롤바를 숨기고 스크롤 동작을 비활성화 */
Expand Down
13 changes: 13 additions & 0 deletions src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { createRoot } from 'react-dom/client';
import './index.css';
import 'slick-carousel/slick/slick.css';
import 'slick-carousel/slick/slick-theme.css';
import { onCLS, onFCP, onLCP, onTTFB } from 'web-vitals';

import Router from './router/router.tsx';

Expand All @@ -16,4 +17,16 @@ document.addEventListener(
{ passive: false }
);

// Web Vitals 측정
function sendToAnalytics(metric: any) {
console.log('Web Vitals:', metric);
// 여기에 분석 도구로 전송하는 코드를 추가할 수 있습니다
// 예: Google Analytics, Mixpanel 등
}

onCLS(sendToAnalytics);
onFCP(sendToAnalytics);
onLCP(sendToAnalytics);
onTTFB(sendToAnalytics);

createRoot(document.getElementById('root')!).render(<Router />);
25 changes: 25 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,29 @@ import tailwindcss from '@tailwindcss/vite';
export default defineConfig({
base: '/', // ✨ 루트 경로 명시
plugins: [react(), tailwindcss()],
build: {
rollupOptions: {
output: {
manualChunks: {
// 핵심 React 라이브러리
'react-vendor': ['react', 'react-dom'],

// 라우팅
router: ['react-router-dom'],

// UI/스타일링
ui: ['react-slick', 'slick-carousel', 'react-toastify'],

// 상태 관리
state: ['zustand'],

// 네트워크/통신
network: ['axios', 'socket.io-client'],

// 유틸리티
utils: ['jwt-decode', 'react-responsive', 'use-sound'],
},
},
},
},
});