UNPKG

@tdb/web

Version:

Common condiguration for serving a web-site and testing web-based UI components.

27 lines (19 loc) 560 B
import env from 'std-env' import Consola from './consola' import Reporters from './reporters' // Attach consola to the global to prevent // duplicated instances when used with different packages/versions let consola = global && global.consola if (!consola) { consola = new Consola({ level: env.debug ? 4 : 3 }) if (env.minimalCLI) { consola.add(new Reporters.BasicReporter()) } else { consola.add(new Reporters.FancyReporter()) } Object.assign(consola, { Consola }, Reporters) global.consola = consola } export default consola