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