Skip to content

Commit c3a20ec

Browse files
committed
Feat: Lazy loading fonts to increase performance
1 parent 750904e commit c3a20ec

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

nuxt.config.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
module.exports = {
44
modules: [
55
"nuxtdown",
6+
"nuxt-webfontloader",
67
['nuxt-fontawesome', {
78
component: 'fab',
89
imports: [
@@ -23,6 +24,14 @@ module.exports = {
2324
env: {
2425
BASE_URL: process.env.BASE_URL || 'http://localhost:3000'
2526
},
27+
/*
28+
** Lazy loading fonts for increased performance
29+
*/
30+
webfontloader: {
31+
google: {
32+
families: ['Eczar:400,500', 'Work Sans:400,500']
33+
}
34+
},
2635
/*
2736
** Headers for EVERY page
2837
*/
@@ -36,7 +45,6 @@ module.exports = {
3645
],
3746
link: [
3847
{ rel: "icon", type: "image/x-icon", href: "/favicon.ico" },
39-
{ rel: "stylesheet", href: "https://fonts.googleapis.com/css?family=Eczar:400,500|Work+Sans:400,500" }
4048
],
4149
},
4250
/*

package-lock.json

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"core-js": "^2.6.5",
2424
"nuxt": "2.2.0",
2525
"nuxt-fontawesome": "^0.4.0",
26+
"nuxt-webfontloader": "^1.0.0",
2627
"nuxtdown": "^2.0.3",
2728
"prismjs": "^1.15.0"
2829
},

0 commit comments

Comments
 (0)