mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-26 21:32:42 +00:00
render.debug ~> debug
debug on build phase affects generated templates too
This commit is contained in:
parent
b78b189aea
commit
1c527c2db6
@ -137,7 +137,7 @@ export default class Builder extends Tapable {
|
||||
options: this.options,
|
||||
uniqBy: _.uniqBy,
|
||||
isDev: this.options.dev,
|
||||
debug: this.options.render.debug,
|
||||
debug: this.options.debug,
|
||||
router: this.options.router,
|
||||
env: this.options.env,
|
||||
head: this.options.head,
|
||||
|
@ -49,8 +49,8 @@ export default function Options (_options) {
|
||||
}
|
||||
|
||||
// Debug errors
|
||||
if (options.render.debug === undefined) {
|
||||
options.render.debug = options.dev
|
||||
if (options.debug === undefined) {
|
||||
options.debug = options.dev
|
||||
}
|
||||
|
||||
// Resolve mode
|
||||
@ -98,6 +98,7 @@ Options.modes = {
|
||||
Options.defaults = {
|
||||
mode: 'universal',
|
||||
dev: process.env.NODE_ENV !== 'production',
|
||||
debug: undefined, // Will be equal to dev if not provided
|
||||
buildDir: '.nuxt',
|
||||
nuxtAppDir: resolve(__dirname, '../lib/app/'), // Relative to dist
|
||||
build: {
|
||||
@ -188,7 +189,6 @@ Options.defaults = {
|
||||
bundleRenderer: {},
|
||||
resourceHints: true,
|
||||
ssr: undefined,
|
||||
debug: undefined, // Will be set equal to dev
|
||||
http2: {
|
||||
push: false
|
||||
},
|
||||
|
@ -286,7 +286,7 @@ export default class Renderer extends Tapable {
|
||||
const sendResponse = (content, type = 'text/html') => {
|
||||
// Set Headers
|
||||
res.statusCode = err.statusCode
|
||||
res.statusMessage = this.options.render.debug ? err.message : err.name
|
||||
res.statusMessage = this.options.debug ? err.message : err.name
|
||||
res.setHeader('Content-Type', type + '; charset=utf-8')
|
||||
res.setHeader('Content-Length', Buffer.byteLength(content))
|
||||
|
||||
@ -299,7 +299,7 @@ export default class Renderer extends Tapable {
|
||||
const isJson = hasReqHeader('accept', 'application/json') || hasReqHeader('user-agent', 'curl/')
|
||||
|
||||
// Use basic errors when debug mode is disabled
|
||||
if (!this.options.render.debug) {
|
||||
if (!this.options.debug) {
|
||||
// Json format is compatible with Youch json responses
|
||||
const json = {
|
||||
status: err.statusCode,
|
||||
|
Loading…
Reference in New Issue
Block a user