@sondh0127/nuxtjs-google-fonts
v1.4.0
Published
Google Fonts module for NuxtJS
Downloads
2
Readme
@nuxtjs/google-fonts
Google Fonts module for NuxtJS
Features
- Specify fonts by name/variant
- Parse head links to Google Fonts
- Creates only an external link to Google Fonts
- Support CSS API v2
- Add dns-prefetch
- Add preconnect
- Add preload
- Download css/fonts to local project (No need external resources)
- Encode fonts to base64
Setup
- Add
@nuxtjs/google-fonts
dependency to your project
yarn add --dev @nuxtjs/google-fonts # or npm install --save-dev @nuxtjs/google-fonts
- Add
@nuxtjs/google-fonts
to thebuildModules
section ofnuxt.config.js
{
buildModules: [
// Simple usage
'@nuxtjs/google-fonts',
// With options
['@nuxtjs/google-fonts', { /* module options */ }]
]
}
:warning: If you are using Nuxt < v2.9 you have to install the module as a dependency
(No --dev
or --save-dev
flags) and use modules
section in nuxt.config.js
instead of buildModules
.
Development
- Clone this repository
- Install dependencies using
yarn install
ornpm install
- Start development server using
yarn dev
ornpm run dev
License
Copyright (c) Nuxt Community