Repository navigation
[CI] Turborepo 빌드 최적화 적용 #46
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
Changes from 3 commits
35f3cdc
e1852cf
fed8094
0714d8e
dec4c34
c8dff07
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 |
|---|---|---|
| @@ -1,10 +1,19 @@ | ||
| "use client"; | ||
|
|
||
| import { QueryClientProvider } from "@tanstack/react-query"; | ||
| import { ReactQueryDevtools } from "@tanstack/react-query-devtools"; | ||
| import dynamic from "next/dynamic"; | ||
|
Contributor
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. 오 이렇게 dynamic 사용하면 번들 크기 최소화할 수가 잇군요! |
||
|
|
||
| import { queryClient } from "@/api/query-client"; | ||
|
|
||
| const ReactQueryDevtools = | ||
| process.env.NODE_ENV === "development" | ||
| ? dynamic(() => | ||
| import("@tanstack/react-query-devtools").then( | ||
| (m) => m.ReactQueryDevtools, | ||
| ), | ||
| ) | ||
| : () => null; | ||
|
Comment on lines
+8
to
+15
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. 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win Devtools는 SSR 경로에서 제외하는 편이 낫습니다. 지금 구현은 개발 환경에서만 lazy-load 되지만, 변경 예시 const ReactQueryDevtools =
process.env.NODE_ENV === "development"
- ? dynamic(() =>
- import("`@tanstack/react-query-devtools`").then(
- (m) => m.ReactQueryDevtools,
- ),
- )
+ ? dynamic(
+ () =>
+ import("`@tanstack/react-query-devtools`").then(
+ (m) => m.ReactQueryDevtools,
+ ),
+ { ssr: false },
+ )
: () => null;Also applies to: 25-25 🤖 Prompt for AI Agents |
||
|
|
||
| interface QueryProviderProps { | ||
| children: React.ReactNode; | ||
| } | ||
|
|
@@ -13,9 +22,7 @@ export const QueryProvider = ({ children }: QueryProviderProps) => { | |
| return ( | ||
| <QueryClientProvider client={queryClient}> | ||
| {children} | ||
| {process.env.NODE_ENV === "development" ? ( | ||
| <ReactQueryDevtools initialIsOpen={false} /> | ||
| ) : null} | ||
| <ReactQueryDevtools initialIsOpen={false} /> | ||
| </QueryClientProvider> | ||
| ); | ||
| }; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,6 +13,7 @@ | |
| "check-types": "tsc --noEmit", | ||
| "storybook": "storybook dev -p 6006", | ||
| "build-storybook": "storybook build", | ||
| "build:storybook": "storybook build", | ||
|
Contributor
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. 두 스크립트가 동일한 명령을 수행하고 있는데 차이가 뭔지 궁금해요~
Member
Author
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. build:storybook은 터보레포 컨벤션에 맞게 추가한 컨벤션으로, 수정하면서 중복이 생겼네요~~~ 제거할게요! |
||
| "chromatic": "chromatic --project-token=$CHROMATIC_PROJECT_TOKEN --only-changed --exit-zero-on-changes" | ||
| }, | ||
| "devDependencies": { | ||
|
|
||
|
Contributor
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. turbo.json에서 ! 붙이면 특정 파일을 빌드 캐시 계산에서 제외할 수 있는지 처음 알았어요!! |
Uh oh!
There was an error while loading. Please reload this page.