OR博客
CDN优化——由Nuxt创建的Vuetify项目
OrdinaryRoad
创建于:2023-12-04 20:25:11
更新于:2023-12-04 20:32:21
新疆
0
13
94
0
一些免费的公共CDN
### 参考链接 #### 相关issues - https://githubfast.com/nuxt-community/vuetify-module/issues/469 - https://githubfast.com/nuxt-community/vuetify-module/issues/108 - https://githubfast.com/nuxt-community/vuetify-module/issues/496 - https://githubfast.com/nuxt-community/vuetify-module/issues/504 #### ping工具 - https://ping.chinaz.com #### 免费CDN - https://unpkg.zhimg.com - https://npm.elemecdn.com - https://cdn.bytedance.com ### 修改`nuxt.config.js` 需要修改两个地方 1. 关闭默认的CDN 2. 添加自定义CDN链接 > 修改好的[nuxt.config.js](https://githubfast.com/OrdinaryRoad-Project/ordinaryroad-blog/blob/main/ordinaryroad-blog-ui/nuxt.config.js) ```js ... // Global page headers: https://go.nuxtjs.dev/config-head head: { link: [ { rel: 'stylesheet', type: 'text/css', href: 'https://npm.elemecdn.com/@mdi/font@latest/css/materialdesignicons.min.css' }, { rel: 'stylesheet', type: 'text/css', href: 'https://unpkg.com/@fontsource/roboto@latest/400.css' } ] } } // Vuetify module configuration: https://go.nuxtjs.dev/config-vuetify vuetify: { defaultAssets: { font: false, icons: false }, font: { family: "Roboto" }, icons: { iconfont: "mdi" } } ... ```
评论