refactor(vue-renderer): remove chalk in renderer (#5609)

This commit is contained in:
Xin Du (Clark) 2019-04-26 12:54:37 +01:00 committed by Pooya Parsa
parent 3539c64b35
commit b7284e1b4a
3 changed files with 3 additions and 6 deletions

View File

@ -1,6 +1,5 @@
import path from 'path' import path from 'path'
import fs from 'fs-extra' import fs from 'fs-extra'
import chalk from 'chalk'
import consola from 'consola' import consola from 'consola'
import template from 'lodash/template' import template from 'lodash/template'
import { isModernRequest } from '@nuxt/utils' import { isModernRequest } from '@nuxt/utils'
@ -202,7 +201,7 @@ export default class VueRenderer {
} }
options.modern = options.render.ssr ? 'server' : 'client' options.modern = options.render.ssr ? 'server' : 'client'
consola.info(`Modern bundles are detected. Modern mode (${chalk.green.bold(options.modern)}) is enabled now.`) consola.info(`Modern bundles are detected. Modern mode (\`${options.modern}\`) is enabled now.`)
} }
createRenderer() { createRenderer() {

View File

@ -1,11 +1,10 @@
import chalk from 'chalk'
import consola from 'consola' import consola from 'consola'
import { loadFixture, getPort, Nuxt, rp, wChunk } from '../utils' import { loadFixture, getPort, Nuxt, rp, wChunk } from '../utils'
let nuxt, port let nuxt, port
const url = route => 'http://localhost:' + port + route const url = route => 'http://localhost:' + port + route
const modernUA = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36' const modernUA = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36'
const modernInfo = mode => `Modern bundles are detected. Modern mode (${chalk.green.bold(mode)}) is enabled now.` const modernInfo = mode => `Modern bundles are detected. Modern mode (\`${mode}\`) is enabled now.`
describe('modern server mode', () => { describe('modern server mode', () => {
beforeAll(async () => { beforeAll(async () => {

View File

@ -1,11 +1,10 @@
import chalk from 'chalk'
import consola from 'consola' import consola from 'consola'
import { loadFixture, getPort, Nuxt, rp } from '../utils' import { loadFixture, getPort, Nuxt, rp } from '../utils'
let nuxt, port, options let nuxt, port, options
const url = route => 'http://localhost:' + port + route const url = route => 'http://localhost:' + port + route
const modernUA = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36' const modernUA = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36'
const modernInfo = mode => `Modern bundles are detected. Modern mode (${chalk.green.bold(mode)}) is enabled now.` const modernInfo = mode => `Modern bundles are detected. Modern mode (\`${mode}\`) is enabled now.`
describe('modern client mode (SPA)', () => { describe('modern client mode (SPA)', () => {
beforeAll(async () => { beforeAll(async () => {