minor: Add ENV into app.html template

This commit is contained in:
Sébastien Chopin 2017-10-28 16:10:01 +02:00
parent 3b9f293e40
commit 262bffc35d

View File

@ -486,6 +486,8 @@ export default class Renderer extends Tapable {
// Basic response if SSR is disabled or spa data provided
const spa = context.spa || (context.res && context.res.spa)
const ENV = this.options.env
if (this.noSSR || spa) {
const { HTML_ATTRS, BODY_ATTRS, HEAD, resourceHints } = await this.metaRenderer.render(context)
const APP = `<div id="__nuxt">${this.resources.loadingHTML}</div>`
@ -496,14 +498,13 @@ export default class Renderer extends Tapable {
throw err
}
const data = {
const html = this.resources.spaTemplate({
HTML_ATTRS,
BODY_ATTRS,
HEAD,
APP
}
const html = this.resources.spaTemplate(data)
APP,
ENV
})
return { html, resourceHints }
}
@ -535,7 +536,8 @@ export default class Renderer extends Tapable {
HTML_ATTRS: 'data-n-head-ssr ' + m.htmlAttrs.text(),
BODY_ATTRS: m.bodyAttrs.text(),
HEAD,
APP
APP,
ENV
})
return {