-1

Is there any easy way to remove any query to google font api "fonts.gstatic.com" in Nuxt.Js ? I would rather provide font files myself.
So far I tried to remove any mention of fonts.gstatic.com from .nuxt/components/index.js, but it seems that the command build reset my modifications, so nothing changed.

My configuration is quite simple, I initialized an app with @nuxt/content-theme-docs.

kissu
  • 40,416
  • 14
  • 65
  • 133
Lou
  • 148
  • 1
  • 12
  • I haven't added anything yet, except for a i18n config in `nuxt.config.js`, to add french language. Here is a [Gitlab link](https://gitlab.com/avalou/avalou-devlog/-/tree/master). – Lou Dec 19 '21 at 14:37
  • Why do you need to load it locally if it's a documentation repo? Performance should not really be a concern here anyway. – kissu Dec 19 '21 at 14:40
  • The repo is still empty for me. I've updated my answer otherwise. – kissu Dec 19 '21 at 15:25
  • 1
    I guess it did, I plan to fork the package as you suggested, using only locally saved font files. – Lou Dec 21 '21 at 18:47

1 Answers1

1

Since the concern is more aimed towards GAFAM (avoid the usage of Google fonts), the solution would be to fork the package for the Nuxt team and strip the related module.

Here is where to find it: https://github.com/nuxt/content/search?q=fonts

This module of Nuxt is aimed towards so fast, pain-free and easy to setup documentation. Hence probably why, Nuxt's team was using such package (since it's still the goto as of today to use Google fonts).


You can follow this answer if you want to use a module on build time: https://stackoverflow.com/a/68166329/8816585

Otherwise, you can use this website to have your fonts locally (link those to your CSS file and you should be fine): https://google-webfonts-helper.herokuapp.com/fonts

kissu
  • 40,416
  • 14
  • 65
  • 133