从 Nuxt 中删除对任何 GAFAM(google api)的请求
Remove requests to any GAFAM (google api here) from Nuxt
是否有任何简单的方法可以删除对 Nuxt.Js 中 google 字体 api "fonts.gstatic.com" 的任何查询?我宁愿自己提供字体文件。
到目前为止,我试图从 .nuxt/components/index.js
中删除对 fonts.gstatic.com 的任何提及,但似乎命令 build
重置了我的修改,所以没有任何改变。
我的配置很简单,我用@nuxt/content-theme-docs
初始化了一个应用程序。
由于更多关注的是 GAFAM(避免使用 Google 字体),解决方案是为 Nuxt 团队分叉包并剥离相关模块。
这里是找到它的地方:https://github.com/nuxt/content/search?q=fonts
Nuxt 的这个模块旨在快速、轻松且易于设置文档。这可能就是为什么,Nuxt 的团队使用这样的包(因为它仍然是今天使用 Google 字体的方法)。
如果你想在构建时使用模块,你可以按照这个答案:
否则,您可以使用此网站在本地安装您的字体(link 那些到您的 CSS 文件,您应该没问题):https://google-webfonts-helper.herokuapp.com/fonts
是否有任何简单的方法可以删除对 Nuxt.Js 中 google 字体 api "fonts.gstatic.com" 的任何查询?我宁愿自己提供字体文件。
到目前为止,我试图从 .nuxt/components/index.js
中删除对 fonts.gstatic.com 的任何提及,但似乎命令 build
重置了我的修改,所以没有任何改变。
我的配置很简单,我用@nuxt/content-theme-docs
初始化了一个应用程序。
由于更多关注的是 GAFAM(避免使用 Google 字体),解决方案是为 Nuxt 团队分叉包并剥离相关模块。
这里是找到它的地方:https://github.com/nuxt/content/search?q=fonts
Nuxt 的这个模块旨在快速、轻松且易于设置文档。这可能就是为什么,Nuxt 的团队使用这样的包(因为它仍然是今天使用 Google 字体的方法)。
如果你想在构建时使用模块,你可以按照这个答案:
否则,您可以使用此网站在本地安装您的字体(link 那些到您的 CSS 文件,您应该没问题):https://google-webfonts-helper.herokuapp.com/fonts