mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
minor: Add ENV into app.html template
This commit is contained in:
parent
3b9f293e40
commit
262bffc35d
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user