node_modules/.cache/nuxt-google-fonts needs to be deleted on font-family addition/removal
See original GitHub issueThe issue:
When updating the font families in nuxt.config.ts
after an initial load, the node_modules/.cache/nuxt-google-fonts
directory doesn’t update the css
or files
contents to match the settings.
How to recreate:
Follow the documentation for installing w/ nuxt3
and select an initial font-family (i.e. Roboto). Add additional families and/or remove the initial family. Update styling to use new families and restart server. If initial family removed, previous styling will break. New families will not be included. Navigate to node_modules/.cache/nuxt-google-fonts/
and view that /css
and /fonts
files only represent the initial settings.
Work around:
Delete the node_modules/.cache/nuxt-google-fonts
directory and restart the nuxt3
server. The module will populate the cache with the updated settings.
Supporting information: versions
"devDependencies": {
"nuxt": "3.0.0-rc.9",
},
"dependencies": {
"@nuxtjs/google-fonts": "^3.0.0-0"
}
nuxt.config.ts
export default defineNuxtConfig({
srcDir: "./src",
modules: ["nuxt-icon", "@nuxtjs/google-fonts"],
googleFonts: {
download: true,
subsets: "latin",
families: {
Roboto: [300, 400, 500, 700],
Ubuntu: [400, 500, 700],
},
},
});
Issue Analytics
- State:
- Created a year ago
- Reactions:5
- Comments:7 (3 by maintainers)
Top GitHub Comments
Fixed in next release https://github.com/nuxt-community/google-fonts-module/pull/105
If the problem persists, please reopen