mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-30 15:22:39 +00:00
deprecate performance key
This commit is contained in:
parent
f5541999fd
commit
1939e08cb2
@ -516,7 +516,6 @@ function createRenderer (bundle, manifest) {
|
||||
cache: cacheConfig,
|
||||
clientManifest: manifest,
|
||||
runInNewContext: false,
|
||||
inject: false,
|
||||
baseDir: this.options.dir
|
||||
}, this.options.build.ssr))
|
||||
this.renderToString = pify(this.renderer.renderToString)
|
||||
|
11
lib/nuxt.js
11
lib/nuxt.js
@ -50,11 +50,10 @@ class Nuxt {
|
||||
extendRoutes: null,
|
||||
scrollBehavior: null
|
||||
},
|
||||
performance: {
|
||||
render: {
|
||||
gzip: {
|
||||
threshold: 0
|
||||
},
|
||||
prefetch: true
|
||||
}
|
||||
},
|
||||
watchers: {
|
||||
webpack: {},
|
||||
@ -94,9 +93,9 @@ class Nuxt {
|
||||
this.serveStaticNuxt = pify(serveStatic(resolve(this.dir, '.nuxt', 'dist'), {
|
||||
maxAge: (this.dev ? 0 : '1y') // 1 year in production
|
||||
}))
|
||||
// gzip for production
|
||||
if (!this.dev && this.options.performance.gzip) {
|
||||
this.gzipMiddleware = pify(compression(this.options.performance.gzip))
|
||||
// gzip middleware for production
|
||||
if (!this.dev && this.options.render.gzip) {
|
||||
this.gzipMiddleware = pify(compression(this.options.render.gzip))
|
||||
}
|
||||
// Add this.Server Class
|
||||
this.Server = Server
|
||||
|
@ -30,7 +30,7 @@ export async function render (req, res) {
|
||||
await this.webpackDevMiddleware(req, res)
|
||||
await this.webpackHotMiddleware(req, res)
|
||||
}
|
||||
if (!this.dev && this.options.performance.gzip) {
|
||||
if (!this.dev && this.options.render.gzip) {
|
||||
await this.gzipMiddleware(req, res)
|
||||
}
|
||||
// If base in req.url, remove it for the middleware and vue-router
|
||||
@ -95,10 +95,7 @@ export async function renderRoute (url, context = {}) {
|
||||
if (this._routerBaseSpecified) {
|
||||
HEAD += `<base href="${this.options.router.base}">`
|
||||
}
|
||||
if (this.options.performance.prefetch) {
|
||||
HEAD += context.renderResourceHints()
|
||||
}
|
||||
HEAD += context.renderStyles()
|
||||
HEAD += context.renderResourceHints() + context.renderStyles()
|
||||
APP += `<script type="text/javascript">window.__NUXT__=${serialize(context.nuxt, { isJSON: true })}</script>`
|
||||
APP += context.renderScripts()
|
||||
const html = this.appTemplate({
|
||||
|
Loading…
Reference in New Issue
Block a user