Skip to content

Commit

Permalink
chore: falling-off performance log. (via --performance to see)
Browse files Browse the repository at this point in the history
  • Loading branch information
ulivz committed Dec 2, 2018
1 parent 2f71e0e commit 246ef8d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/@vuepress/core/lib/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ module.exports = async function build (sourceDir, cliOptions = {}) {
const relativeDir = path.relative(cwd, outDir)
logger.success(`Generated static files in ${chalk.cyan(relativeDir)}.`)
const { duration } = performance.stop()
logger.debug(`It took a total of ${chalk.cyan(`${duration}ms`)} to run the ${chalk.cyan('vuepress build')}.`)
logger.developer(`It took a total of ${chalk.cyan(`${duration}ms`)} to run the ${chalk.cyan('vuepress build')}.`)
console.log()

// --- helpers ---
Expand Down
2 changes: 1 addition & 1 deletion packages/@vuepress/core/lib/webpack/DevLogPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ module.exports = class DevLogPlugin {
isFirst = false
console.log(`${chalk.gray('>')} VuePress dev server listening at ${chalk.cyan(displayUrl)}`)
const { duration } = performance.stop()
logger.debug(`It took a total of ${chalk.cyan(`${duration}ms`)} to run the ${chalk.cyan('vuepress dev')} for the first time.`)
logger.developer(`It took a total of ${chalk.cyan(`${duration}ms`)} to run the ${chalk.cyan('vuepress dev')} for the first time.`)
}
})
compiler.hooks.invalid.tap('vuepress-log', clearScreen)
Expand Down
2 changes: 1 addition & 1 deletion packages/@vuepress/shared-utils/lib/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class Logger {
}

developer (...args) {
if (process.env.VUEPRESS_ENV !== 'developer') {
if (process.env.VUEPRESS_ENV !== 'developer' || process.argv.includes('--developer')) {
return
}
this.status('cyan', 'developer', ...args)
Expand Down

0 comments on commit 246ef8d

Please sign in to comment.