-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/lazyloading #20
Feat/lazyloading #20
Changes from all commits
fa1c1cd
9d7f5aa
cc18fff
e3b0dff
5f040fc
9702745
819aea9
874601f
eb2bb42
5afdf48
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,8 +3,6 @@ | |
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0" /> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/reset.min.css"> | ||
<title>Blank</title> | ||
</head> | ||
<body> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,25 @@ | ||
import { createBrowserRouter, RouterProvider } from "react-router-dom"; | ||
import { Suspense } from "react"; | ||
import Layout from "./components/Layout"; | ||
import routerInfo from "./shared/routing/routerInfo.tsx"; | ||
|
||
const RouterPath = routerInfo.map((info) => { | ||
return { | ||
path: info.path, | ||
element: info.element, | ||
}; | ||
}); | ||
import routerInfo from "./shared/routing/routerInfo"; | ||
|
||
const router = createBrowserRouter([ | ||
{ | ||
path: "/", | ||
element: <Layout />, | ||
children: RouterPath, | ||
children: routerInfo.map(({ path, element: Element }) => ({ | ||
path, | ||
element: ( | ||
<Suspense fallback={<div>Loading...</div>}> | ||
<Element /> | ||
</Suspense> | ||
), | ||
})), | ||
}, | ||
]); | ||
|
||
function App() { | ||
return <RouterProvider router={router} />; | ||
} | ||
|
||
export default App; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@import url("https://cdn.jsdelivr.net/npm/[email protected]/reset.min.css"); | ||
@import url("https://cdn.jsdelivr.net/gh/orioncactus/[email protected]/dist/web/variable/pretendardvariable-dynamic-subset.min.css"); | ||
@import url("https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0"); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,5 @@ | ||
import { createGlobalTheme, fontFace } from "@vanilla-extract/css"; | ||
|
||
const pretendardRegular = fontFace({ | ||
src: "url('https://fastly.jsdelivr.net/gh/Project-Noonnu/[email protected]/Pretendard-Regular.woff') format('woff')", | ||
fontWeight: 400, | ||
fontStyle: "normal", | ||
}); | ||
const pyeongChangBold = fontFace({ | ||
src: "url('https://fastly.jsdelivr.net/gh/projectnoonnu/[email protected]/PyeongChangPeace-Bold.woff2') format('woff2');", | ||
fontWeight: 700, | ||
|
@@ -27,7 +22,7 @@ export const vars = createGlobalTheme("#root", { | |
white: "#FFFFFF", | ||
}, | ||
font: { | ||
pretendardRegular, | ||
pretendardRegular: "pretendard, sans-serif", // for debug: ,Courier New", // <-독특함 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 폰트 import 최적화를 수행했습니다.
|
||
pyeongChangBold, | ||
pyeongChangLight, | ||
}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,4 +27,22 @@ export default defineConfig({ | |
}), | ||
}), | ||
], | ||
build: { | ||
rollupOptions: { | ||
output: { | ||
manualChunks: (id: string) => { | ||
if (id.includes("node_modules")) { | ||
const module: string = id.split("node_modules/").pop()!.split("/")[0]; | ||
if (module.includes("react")) { | ||
return "react-vendor"; | ||
} | ||
Comment on lines
+36
to
+38
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 번들링 최적화를 수행했습니다.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 나머지 모듈들은 따로 분리되어 필요할 때 import 됩니다. |
||
// if (module.includes("poo")) { | ||
// return "poo-vendor"; | ||
// } | ||
return `vendor-${module}`; | ||
} | ||
}, | ||
}, | ||
}, | ||
}, | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
css 초기화 로직인데 그냥 가져왔습니다.
중복 여부 및 수정 방안 제시 부탁드립니다. @dandamdandam
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/jjh4450/KNU-festival24/blob/874601fc3ba4f9dd53864e3a297d9ec95f00c438/index.html#L7
이전에 작성해둔 건데, index.css에서 관리하는게 더 좋아보입니다. index.html에 위 코드 삭제해주세요!