mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-30 15:22:39 +00:00
update render references
This commit is contained in:
parent
b79f845842
commit
5768ef5092
@ -63,7 +63,7 @@ export default class Renderer extends Tapable {
|
||||
await this.nuxt.builder.webpackHotMiddleware(req, res)
|
||||
}
|
||||
if (!this.options.dev && this.options.render.gzip) {
|
||||
await this.nuxt.gzipMiddleware(req, res)
|
||||
await this.gzipMiddleware(req, res)
|
||||
}
|
||||
// If base in req.url, remove it for the middleware and vue-router
|
||||
if (this.options.router.base !== '/' && req.url.indexOf(this.options.router.base) === 0) {
|
||||
@ -71,12 +71,12 @@ export default class Renderer extends Tapable {
|
||||
req.url = req.url.replace(this.options.router.base, '/')
|
||||
}
|
||||
// Serve static/ files
|
||||
await this.nuxt.serveStatic(req, res)
|
||||
await this.serveStatic(req, res)
|
||||
// Serve .nuxt/dist/ files (only for production)
|
||||
if (!this.options.dev && req.url.indexOf(this.options.build.publicPath) === 0) {
|
||||
const url = req.url
|
||||
req.url = req.url.replace(this.options.build.publicPath, '/')
|
||||
await this.nuxt.serveStaticNuxt(req, res)
|
||||
await this.serveStaticNuxt(req, res)
|
||||
/* istanbul ignore next */
|
||||
req.url = url
|
||||
}
|
||||
@ -127,7 +127,7 @@ export default class Renderer extends Tapable {
|
||||
console.error(err) // eslint-disable-line no-console
|
||||
return err
|
||||
}
|
||||
const html = this.nuxt.errorTemplate({
|
||||
const html = this.errorTemplate({
|
||||
/* istanbul ignore if */
|
||||
error: err,
|
||||
stack: ansiHTML(encodeHtml(err.stack))
|
||||
|
Loading…
Reference in New Issue
Block a user