From 0f8530819111b19cd872bf90aa759c8042b96301 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Tue, 20 Jun 2017 17:18:25 +0430 Subject: [PATCH] add render.resourceHints option #899 --- lib/core/options.js | 1 + lib/core/renderer.js | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/core/options.js b/lib/core/options.js index 90e990b3eb..89c70fac66 100755 --- a/lib/core/options.js +++ b/lib/core/options.js @@ -131,6 +131,7 @@ const defaultOptions = { }, render: { ssr: {}, + resourceHints: true, http2: { push: false }, diff --git a/lib/core/renderer.js b/lib/core/renderer.js index c54820eb82..c2c9324eae 100644 --- a/lib/core/renderer.js +++ b/lib/core/renderer.js @@ -328,8 +328,14 @@ export default class Renderer extends Tapable { if (this.options._routerBaseSpecified) { HEAD += `` } - const resourceHints = context.renderResourceHints() - HEAD += resourceHints + context.renderStyles() + + let resourceHints = '' + if (this.options.render.resourceHints) { + resourceHints = context.renderResourceHints() + HEAD += resourceHints + } + + HEAD += context.renderStyles() APP += `` APP += context.renderScripts()