perf(web): self-host Font Awesome instead of cdnjs CDN
Replace the external cdnjs.cloudflare.com <link> with a bundled npm import so FA CSS+fonts ship as static assets through the same Cloudflare CDN that serves the app — eliminates an extra DNS lookup and third-party CDN dependency, improves reliability for China users. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
+1
-5
@@ -5,6 +5,7 @@ import { Analytics } from "@/components/Analytics";
|
||||
import { LOCALES, DEFAULT_LOCALE, type Locale } from "@/lib/i18n/config";
|
||||
import { localePath } from "@/lib/i18n/navigation";
|
||||
import { stripLocalePrefix } from "@/lib/i18n/navigation";
|
||||
import "@fortawesome/fontawesome-free/css/all.min.css";
|
||||
import "./globals.css";
|
||||
|
||||
// Editorial fonts: drive tailwind `font-serif`/`font-sans` via
|
||||
@@ -61,11 +62,6 @@ export default async function RootLayout({
|
||||
suppressHydrationWarning
|
||||
>
|
||||
<head>
|
||||
{/* Font Awesome — fa-solid icons used by home, /play, /new, CustomForm. */}
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css"
|
||||
/>
|
||||
{LOCALES.map((l) => (
|
||||
<link
|
||||
key={l}
|
||||
|
||||
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
/// <reference types="next" />
|
||||
/// <reference types="next/image-types/global" />
|
||||
import "./.next/dev/types/routes.d.ts";
|
||||
import "./.next/types/routes.d.ts";
|
||||
|
||||
// NOTE: This file should not be edited
|
||||
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
"deploy:cf": "opennextjs-cloudflare deploy"
|
||||
},
|
||||
"dependencies": {
|
||||
"@fortawesome/fontawesome-free": "6.5.1",
|
||||
"@supabase/ssr": "^0.12",
|
||||
"@supabase/supabase-js": "^2.108",
|
||||
"drizzle-orm": "^0.45.2",
|
||||
|
||||
Generated
+9
@@ -8,6 +8,9 @@ importers:
|
||||
|
||||
.:
|
||||
dependencies:
|
||||
'@fortawesome/fontawesome-free':
|
||||
specifier: 6.5.1
|
||||
version: 6.5.1
|
||||
'@supabase/ssr':
|
||||
specifier: ^0.12
|
||||
version: 0.12.0(@supabase/supabase-js@2.108.1)
|
||||
@@ -1003,6 +1006,10 @@ packages:
|
||||
cpu: [x64]
|
||||
os: [win32]
|
||||
|
||||
'@fortawesome/fontawesome-free@6.5.1':
|
||||
resolution: {integrity: sha512-CNy5vSwN3fsUStPRLX7fUYojyuzoEMSXPl7zSLJ8TgtRfjv24LOnOWKT2zYwaHZCJGkdyRnTmstR0P+Ah503Gw==}
|
||||
engines: {node: '>=6'}
|
||||
|
||||
'@img/colour@1.1.0':
|
||||
resolution: {integrity: sha512-Td76q7j57o/tLVdgS746cYARfSyxk8iEfRxewL9h4OMzYhbW4TAcppl0mT4eyqXddh6L/jwoM75mo7ixa/pCeQ==}
|
||||
engines: {node: '>=18'}
|
||||
@@ -3893,6 +3900,8 @@ snapshots:
|
||||
'@esbuild/win32-x64@0.28.1':
|
||||
optional: true
|
||||
|
||||
'@fortawesome/fontawesome-free@6.5.1': {}
|
||||
|
||||
'@img/colour@1.1.0': {}
|
||||
|
||||
'@img/sharp-darwin-arm64@0.33.5':
|
||||
|
||||
Reference in New Issue
Block a user