Skip to content

feat(web): Use local fonts in Next.js app to improve build times#626

Merged
rajat1saxena merged 3 commits intomainfrom
feat/local-fonts-nextjs
Sep 1, 2025
Merged

feat(web): Use local fonts in Next.js app to improve build times#626
rajat1saxena merged 3 commits intomainfrom
feat/local-fonts-nextjs

Conversation

@rajat1saxena
Copy link
Copy Markdown
Member

Switches from using next/font/google to next/font/local for all fonts used in the apps/web Next.js application.

This change involves:

  • Downloading all previously used Google Fonts (WOFF2 format) and storing them locally in apps/web/public/fonts/.
  • Updating apps/web/lib/fonts.ts to define fonts using next/font/local, pointing to the locally stored font files.
  • Modifying apps/web/app/layout.tsx to utilize the locally defined Inter font from lib/fonts.ts.
  • Verifying that the existing Docker configuration (services/app/Dockerfile) correctly includes the apps/web/public/fonts/ directory in the final image.

This approach aims to reduce build times by avoiding font downloads during the build process and bundles the fonts directly with the application.

Switches from using `next/font/google` to `next/font/local` for all fonts
used in the `apps/web` Next.js application.

This change involves:
- Downloading all previously used Google Fonts (WOFF2 format) and storing them locally in `apps/web/public/fonts/`.
- Updating `apps/web/lib/fonts.ts` to define fonts using `next/font/local`, pointing to the locally stored font files.
- Modifying `apps/web/app/layout.tsx` to utilize the locally defined `Inter` font from `lib/fonts.ts`.
- Verifying that the existing Docker configuration (`services/app/Dockerfile`) correctly includes the `apps/web/public/fonts/` directory in the final image.

This approach aims to reduce build times by avoiding font downloads during the build process and bundles the fonts directly with the application.
@vercel
Copy link
Copy Markdown

vercel bot commented Aug 31, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
courselit-docs Ready Ready Preview Comment Aug 31, 2025 4:42pm

@rajat1saxena rajat1saxena merged commit 2039bdc into main Sep 1, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant