From 08349031529637ff2d81e79ec8f5d7ac60eb6173 Mon Sep 17 00:00:00 2001 From: "Xin Du (Clark)" Date: Tue, 8 Oct 2019 10:06:29 +0100 Subject: [PATCH] fix(vue-app, webpack): remove consola from client (#6504) --- packages/vue-app/template/client.js | 14 +++++--------- packages/webpack/src/config/base.js | 1 - 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/packages/vue-app/template/client.js b/packages/vue-app/template/client.js index 9aa4b66766..a0fb5b37b2 100644 --- a/packages/vue-app/template/client.js +++ b/packages/vue-app/template/client.js @@ -18,11 +18,6 @@ import { } from './utils.js' import { createApp<% if (features.layouts) { %>, NuxtError<% } %> } from './index.js' import NuxtLink from './components/nuxt-link.<%= features.clientPrefetch ? "client" : "server" %>.js' // should be included after ./index.js -<% if (isDev) { %>import consola from 'consola'<% } %> - -<% if (isDev) { %>consola.wrapConsole() -console.log = console.__log -<% } %> // Component: Vue.component(NuxtLink.name, NuxtLink) @@ -43,11 +38,12 @@ Object.assign(Vue.config, <%= serialize(vue.config) %>)<%= isTest ? '// eslint-d <% if (nuxtOptions.render.ssrLog) { %> const logs = NUXT.logs || [] -if (logs.length > 0) { - console.group<%= nuxtOptions.render.ssrLog === 'collapsed' ? 'Collapsed' : '' %>("%c🚀 Nuxt SSR Logs", 'font-size: 110%') - logs.forEach(logObj => consola[logObj.type](logObj)) + if (logs.length > 0) { + const ssrLogSyle = 'background: #2E495E;border-radius: 0.5em;color: white;font-weight: bold;padding: 2px 0.5em;' + console.group && console.group <%= nuxtOptions.render.ssrLog === 'collapsed' ? 'Collapsed' : '' %> ("%cNuxt SSR", ssrLogSyle) + logs.forEach(logObj => (console[logObj.type] || console.log)(...logObj.args)) delete NUXT.logs - console.groupEnd() + console.groupEnd && console.groupEnd() } <% } %> <% if (debug) { %> diff --git a/packages/webpack/src/config/base.js b/packages/webpack/src/config/base.js index 6234e1e61f..19f56bf70e 100644 --- a/packages/webpack/src/config/base.js +++ b/packages/webpack/src/config/base.js @@ -225,7 +225,6 @@ export default class WebpackBaseConfig { alias () { return { ...this.buildContext.options.alias, - consola: require.resolve(`consola/${this.isServer ? 'dist/consola' : 'src/browser'}.js`), 'vue-meta': require.resolve(`vue-meta${this.isServer ? '' : '/dist/vue-meta.esm.browser.js'}`) } }