Skip to content

Commit

Permalink
fix: use consola for output info (#184)
Browse files Browse the repository at this point in the history
  • Loading branch information
dword-design committed Apr 28, 2021
1 parent 6078d7f commit c6c3f66
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -55,5 +56,8 @@
"pug-plain-loader": "latest",
"siroc": "0.9.2",
"standard-version": "latest"
},
"peerDependencies": {
"consola": "^2.15.3"
}
}
5 changes: 3 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -93,7 +94,7 @@ const componentsModule: Module<Options> = 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) {
Expand Down Expand Up @@ -172,7 +173,7 @@ const componentsModule: Module<Options> = 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))
})
}

Expand Down

0 comments on commit c6c3f66

Please sign in to comment.