performance.prefetch

This commit is contained in:
Pooya Parsa 2017-05-19 12:15:36 +04:30
parent 90fc778e81
commit effb354d71
2 changed files with 6 additions and 2 deletions

View File

@ -53,7 +53,8 @@ class Nuxt {
performance: {
gzip: {
threshold: 0
}
},
prefetch: true
},
watchers: {
webpack: {},

View File

@ -95,7 +95,10 @@ export async function renderRoute (url, context = {}) {
if (this._routerBaseSpecified) {
HEAD += `<base href="${this.options.router.base}">`
}
HEAD += context.renderResourceHints() + context.renderStyles()
if (this.options.performance.prefetch) {
HEAD += context.renderResourceHints()
}
HEAD += context.renderStyles()
APP += `<script type="text/javascript">window.__NUXT__=${serialize(context.nuxt, { isJSON: true })}</script>`
APP += context.renderScripts()
const html = this.appTemplate({