mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 22:25: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(
|
||||
new HTMLPlugin({
|
||||
template: this.options.appTemplatePath,
|
||||
inject: this.options.render.ssr === false,
|
||||
inject: this.options.ssr === false,
|
||||
chunksSortMode: 'dependency'
|
||||
})
|
||||
)
|
||||
|
@ -130,8 +130,9 @@ export const defaultOptions = {
|
||||
scrollBehavior: null,
|
||||
fallback: false
|
||||
},
|
||||
render: {
|
||||
ssr: {},
|
||||
render: {
|
||||
bundleRenderer: {},
|
||||
resourceHints: true,
|
||||
http2: {
|
||||
push: false
|
||||
|
@ -121,7 +121,7 @@ export default class Renderer extends Tapable {
|
||||
}
|
||||
|
||||
get noSSR () {
|
||||
return this.options.render.ssr === false
|
||||
return this.options.ssr === false
|
||||
}
|
||||
|
||||
createRenderer () {
|
||||
@ -140,13 +140,7 @@ export default class Renderer extends Tapable {
|
||||
clientManifest: this.resources.clientManifest,
|
||||
runInNewContext: false,
|
||||
basedir: this.options.rootDir
|
||||
}, this.options.render.ssr, this.options.build.ssr))
|
||||
|
||||
/* 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!')
|
||||
}
|
||||
}, this.options.render.bundleRenderer))
|
||||
|
||||
// Promisify renderToString
|
||||
this.bundleRenderer.renderToString = pify(this.bundleRenderer.renderToString)
|
||||
|
Loading…
Reference in New Issue
Block a user