Skip to content

Lazy-load Japanese fonts only for Japanese users#932

Merged
jcmartinezdev merged 2 commits into
masterfrom
feature/lazy-load-japanese-fonts
Apr 28, 2026
Merged

Lazy-load Japanese fonts only for Japanese users#932
jcmartinezdev merged 2 commits into
masterfrom
feature/lazy-load-japanese-fonts

Conversation

@jcmartinezdev
Copy link
Copy Markdown
Contributor

Move Japanese Noto Sans JP fonts (~13MB) out of Next.js bundling to avoid loading them for English users. Fonts are now loaded via CSS @font-face only when languageCode === "ja".

  • Move NotoSansJP fonts from src/libs/theme/fonts/ to public/fonts/
  • Add public/fonts/japanese-fonts.css with @font-face declarations
  • Remove JapaneseFont from next/font/local in fonts.tsx
  • Conditionally load CSS stylesheet in page-layout for Japanese
  • Add fonts/ to middleware matcher exclusions
Move Japanese Noto Sans JP fonts (~13MB) out of Next.js bundling to avoid
loading them for English users. Fonts are now loaded via CSS @font-face
only when languageCode === "ja".

- Move NotoSansJP fonts from src/libs/theme/fonts/ to public/fonts/
- Add public/fonts/japanese-fonts.css with @font-face declarations
- Remove JapaneseFont from next/font/local in fonts.tsx
- Conditionally load CSS stylesheet in page-layout for Japanese
- Add fonts/ to middleware matcher exclusions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

Keep both llms.txt (from master) and fonts/ (from this branch) in exclusions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

@jcmartinezdev jcmartinezdev merged commit 3926df9 into master Apr 28, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants