fix(vue-app, webpack): remove consola from client (#6504)

This commit is contained in:
Xin Du (Clark) 2019-10-08 10:06:29 +01:00 committed by Pooya Parsa
parent 2d27a4d2dc
commit 0834903152
2 changed files with 5 additions and 10 deletions

View File

@ -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: <NuxtLink>
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) { %>

View File

@ -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'}`)
}
}