From c6c3f66f0bb86c3d7a2a1eac737aa145e64b0fc7 Mon Sep 17 00:00:00 2001 From: Sebastian Landwehr Date: Wed, 28 Apr 2021 13:08:09 +0200 Subject: [PATCH] fix: use consola for output info (#184) --- package.json | 4 ++++ src/index.ts | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 35c25ab..cef666d 100644 --- a/package.json +++ b/package.json @@ -47,6 +47,7 @@ "@types/loader-utils": "latest", "@types/lodash": "latest", "@types/semver": "latest", + "consola": "^2.15.3", "eslint": "latest", "jest": "latest", "loader-utils": "latest", @@ -55,5 +56,8 @@ "pug-plain-loader": "latest", "siroc": "0.9.2", "standard-version": "latest" + }, + "peerDependencies": { + "consola": "^2.15.3" } } diff --git a/src/index.ts b/src/index.ts index 14c649c..10fc6db 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,6 +3,7 @@ import path from 'upath' import chokidar from 'chokidar' import type { Configuration as WebpackConfig, Entry as WebpackEntry } from 'webpack' import type { Module } from '@nuxt/types/config' +import consola from 'consola' import { requireNuxtVersion } from './compatibility' import { scanComponents } from './scan' @@ -93,7 +94,7 @@ const componentsModule: Module = function () { // Add loader for tree shaking in production only if (options.loader) { // eslint-disable-next-line no-console - console.info('Using components loader to optimize imports') + consola.info('Using components loader to optimize imports') this.extendBuild((config) => { const vueRule = config.module?.rules.find(rule => rule.test?.toString().includes('.vue')) if (!vueRule) { @@ -172,7 +173,7 @@ const componentsModule: Module = function () { // Add CLI info to inspect discovered components const componentsListFile = path.resolve(nuxt.options.buildDir, 'components/readme.md') // eslint-disable-next-line no-console - console.info('Discovered Components:', path.relative(process.cwd(), componentsListFile)) + consola.info('Discovered Components:', path.relative(process.cwd(), componentsListFile)) }) }