Skip to content

Commit 43ecb57

Browse files
committed
Update SPA routing configuration for GitHub Pages
1 parent fa79b02 commit 43ecb57

3 files changed

Lines changed: 12 additions & 6 deletions

File tree

index.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
<title>project2</title>
88
<script type="text/javascript">
99
// GitHub Pages SPA 라우팅 지원
10-
// 404.html에서 리다이렉트된 URL 파라미터를 처리
1110
(function(l) {
1211
if (l.search[1] === '/' ) {
1312
var decoded = l.search.slice(1).split('&').map(function(s) {

public/404.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
<!DOCTYPE html>
2-
<html>
2+
<html lang="ko">
33
<head>
44
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
56
<title>404</title>
67
<script type="text/javascript">
7-
// GitHub Pages에서 SPA 라우팅을 위한 리다이렉트 스크립트
8-
// 현재 URL을 확인하고 해당 경로로 리다이렉트
9-
var pathSegmentsToKeep = 0;
10-
8+
// GitHub Pages SPA 라우팅을 위한 리다이렉트
9+
var pathSegmentsToKeep = 1;
1110
var l = window.location;
1211
l.replace(
1312
l.protocol + '//' + l.hostname + (l.port ? ':' + l.port : '') +
@@ -19,5 +18,6 @@
1918
</script>
2019
</head>
2120
<body>
21+
<div>리다이렉트 중...</div>
2222
</body>
2323
</html>

vite.config.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,11 @@ export default defineConfig({
1313
tailwindcss(),
1414
],
1515
base: process.env.NODE_ENV === 'production' ? '/FE7-PROJECT2-TEAM-5/' : '/',
16+
build: {
17+
rollupOptions: {
18+
output: {
19+
manualChunks: undefined,
20+
},
21+
},
22+
},
1623
});

0 commit comments

Comments
 (0)