diff --git a/lib/module.js b/lib/module.js
index 48b0bee..8220229 100644
--- a/lib/module.js
+++ b/lib/module.js
@@ -84,6 +84,7 @@ module.exports = function (moduleOptions) {
// https://developer.mozilla.org/en-US/docs/Web/Performance/dns-prefetch
if (options.prefetch) {
this.options.head.link.push({
+ hid: 'gf-prefetch',
once: true,
rel: 'dns-prefetch',
href: 'https://fonts.gstatic.com/'
@@ -94,6 +95,7 @@ module.exports = function (moduleOptions) {
// connect to domain of font files
if (options.preconnect) {
this.options.head.link.push({
+ hid: 'gf-preconnect',
once: true,
rel: 'preconnect',
href: 'https://fonts.gstatic.com/',
@@ -105,6 +107,7 @@ module.exports = function (moduleOptions) {
// optionally increase loading priority
if (options.preload) {
this.options.head.link.push({
+ hid: 'gf-preload',
once: true,
rel: 'preload',
as: 'style',
@@ -114,6 +117,7 @@ module.exports = function (moduleOptions) {
// async CSS
this.options.head.link.push({
+ hid: 'gf-stylesheet',
once: true,
rel: 'stylesheet',
href: url,
@@ -124,6 +128,7 @@ module.exports = function (moduleOptions) {
// no-JS fallback
this.options.head.noscript = this.options.head.noscript || []
this.options.head.noscript.push({
+ hid: 'gf-noscript',
once: true,
innerHTML: ``
})
diff --git a/test/basic.test.js b/test/basic.test.js
index a8b979e..cbf03d7 100644
--- a/test/basic.test.js
+++ b/test/basic.test.js
@@ -14,10 +14,10 @@ describe('basic', () => {
test('render', async () => {
const url = 'https://fonts.googleapis.com/css2?family=Roboto&family=Lato'
const html = await get('/')
- expect(html).toContain('')
- expect(html).toContain('')
- expect(html).toContain(``)
- expect(html).toContain(``)
+ expect(html).toContain('')
+ expect(html).toContain('')
+ expect(html).toContain(``)
+ expect(html).toContain(``)
})
})
diff --git a/test/fixture/basic/pages/about.vue b/test/fixture/basic/pages/about.vue
new file mode 100644
index 0000000..70c2abc
--- /dev/null
+++ b/test/fixture/basic/pages/about.vue
@@ -0,0 +1,10 @@
+
+
+
diff --git a/test/fixture/basic/pages/index.vue b/test/fixture/basic/pages/index.vue
index 6218ede..b73aa70 100644
--- a/test/fixture/basic/pages/index.vue
+++ b/test/fixture/basic/pages/index.vue
@@ -1,6 +1,11 @@