1+ /* eslint-disable @next/next/no-css-tags */
12import type { Metadata , Viewport } from "next" ;
3+ import dynamic from "next/dynamic" ;
24import { Inter } from "next/font/google" ;
35import localFont from "next/font/local" ;
46
57import GlobalLayout from "@/components/layout/GlobalLayout" ;
68
7- import "../styles/globals.css" ;
8-
99import { AlertProvider } from "@/context/AlertContext" ;
10- import AppleScriptLoader from "@/lib/ScriptLoader/AppleScriptLoader" ;
11- import KakaoScriptLoader from "@/lib/ScriptLoader/KakaoScriptLoader" ;
1210import QueryProvider from "@/lib/react-query/QueryProvider" ;
1311import { GoogleAnalytics } from "@next/third-parties/google" ;
1412
@@ -29,6 +27,15 @@ const pretendard = localFont({
2927 variable : "--font-pretendard" ,
3028} ) ;
3129
30+ const KakaoScriptLoader = dynamic ( ( ) => import ( "@/lib/ScriptLoader/KakaoScriptLoader" ) , {
31+ ssr : false ,
32+ loading : ( ) => null ,
33+ } ) ;
34+ const AppleScriptLoader = dynamic ( ( ) => import ( "@/lib/ScriptLoader/AppleScriptLoader" ) , {
35+ ssr : false ,
36+ loading : ( ) => null ,
37+ } ) ;
38+
3239declare global {
3340 interface Window {
3441 // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -46,6 +53,20 @@ export const viewport: Viewport = {
4653const RootLayout = ( { children } : { children : React . ReactNode } ) => (
4754 < AlertProvider >
4855 < html lang = "ko" >
56+ < head >
57+ < link rel = "preload" href = "/_next/static/css/globals.css" as = "style" />
58+ < link
59+ rel = "stylesheet"
60+ href = "/_next/static/css/globals.css"
61+ media = "print"
62+ onLoad = { ( e ) => {
63+ ( e . currentTarget as HTMLLinkElement ) . media = "all" ;
64+ } }
65+ />
66+ < noscript >
67+ < link rel = "stylesheet" href = "/_next/static/css/globals.css" />
68+ </ noscript >
69+ </ head >
4970 < KakaoScriptLoader />
5071 < AppleScriptLoader />
5172 < GoogleAnalytics gaId = "G-V1KLYZC1DS" />
0 commit comments