mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 16:12:12 +00:00
feat: top level ssr option
This commit is contained in:
parent
0831f9c5bc
commit
9475e1c431
@ -64,7 +64,7 @@ export default function webpackClientConfig () {
|
|||||||
config.plugins.push(
|
config.plugins.push(
|
||||||
new HTMLPlugin({
|
new HTMLPlugin({
|
||||||
template: this.options.appTemplatePath,
|
template: this.options.appTemplatePath,
|
||||||
inject: this.options.render.ssr === false,
|
inject: this.options.ssr === false,
|
||||||
chunksSortMode: 'dependency'
|
chunksSortMode: 'dependency'
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
@ -130,8 +130,9 @@ export const defaultOptions = {
|
|||||||
scrollBehavior: null,
|
scrollBehavior: null,
|
||||||
fallback: false
|
fallback: false
|
||||||
},
|
},
|
||||||
render: {
|
|
||||||
ssr: {},
|
ssr: {},
|
||||||
|
render: {
|
||||||
|
bundleRenderer: {},
|
||||||
resourceHints: true,
|
resourceHints: true,
|
||||||
http2: {
|
http2: {
|
||||||
push: false
|
push: false
|
||||||
|
@ -121,7 +121,7 @@ export default class Renderer extends Tapable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get noSSR () {
|
get noSSR () {
|
||||||
return this.options.render.ssr === false
|
return this.options.ssr === false
|
||||||
}
|
}
|
||||||
|
|
||||||
createRenderer () {
|
createRenderer () {
|
||||||
@ -140,13 +140,7 @@ export default class Renderer extends Tapable {
|
|||||||
clientManifest: this.resources.clientManifest,
|
clientManifest: this.resources.clientManifest,
|
||||||
runInNewContext: false,
|
runInNewContext: false,
|
||||||
basedir: this.options.rootDir
|
basedir: this.options.rootDir
|
||||||
}, this.options.render.ssr, this.options.build.ssr))
|
}, this.options.render.bundleRenderer))
|
||||||
|
|
||||||
/* istanbul ignore if */
|
|
||||||
if (this.options.build.ssr) {
|
|
||||||
// eslint-disable-next-line no-console
|
|
||||||
console.warn('[nuxt] `build.ssr` is deprecated and will be removed in 1.0 release, please use `render.ssr` instead!')
|
|
||||||
}
|
|
||||||
|
|
||||||
// Promisify renderToString
|
// Promisify renderToString
|
||||||
this.bundleRenderer.renderToString = pify(this.bundleRenderer.renderToString)
|
this.bundleRenderer.renderToString = pify(this.bundleRenderer.renderToString)
|
||||||
|
Loading…
Reference in New Issue
Block a user