From effb354d716564edc05f2bf84b00768cb21f22ef Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Fri, 19 May 2017 12:15:36 +0430 Subject: [PATCH] performance.prefetch --- lib/nuxt.js | 3 ++- lib/render.js | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/nuxt.js b/lib/nuxt.js index 5053327f0b..cbe91a83a4 100644 --- a/lib/nuxt.js +++ b/lib/nuxt.js @@ -53,7 +53,8 @@ class Nuxt { performance: { gzip: { threshold: 0 - } + }, + prefetch: true }, watchers: { webpack: {}, diff --git a/lib/render.js b/lib/render.js index 467ec9099c..9199c9153a 100644 --- a/lib/render.js +++ b/lib/render.js @@ -95,7 +95,10 @@ export async function renderRoute (url, context = {}) { if (this._routerBaseSpecified) { HEAD += `` } - HEAD += context.renderResourceHints() + context.renderStyles() + if (this.options.performance.prefetch) { + HEAD += context.renderResourceHints() + } + HEAD += context.renderStyles() APP += `` APP += context.renderScripts() const html = this.appTemplate({