From 0fece913e5f829932bea266c722fa4ade6f181c4 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Thu, 13 Jul 2017 13:29:10 +0430 Subject: [PATCH] feat(app): hide error logs in production --- lib/app/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/app/index.js b/lib/app/index.js index 6a42150fb2..8e70820216 100644 --- a/lib/app/index.js +++ b/lib/app/index.js @@ -92,8 +92,10 @@ async function createApp (ssrContext) { const _nuxt = this._nuxt || this.$options._nuxt _nuxt.dateErr = Date.now() _nuxt.err = err - console.error(err) - console.error('[nuxt] ' + err) + if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') { + console.error(err) + console.error('[nuxt] ' + err) + } return err } },