feat: syntax highlight inspect output (#3844)

This commit is contained in:
Guillaume Chau
2019-04-18 17:03:11 +02:00
committed by GitHub
parent 0d7908bc4a
commit 89e0697cc9
3 changed files with 15 additions and 2 deletions
@@ -17,6 +17,7 @@ module.exports = (api, options) => {
const chalk = require('chalk')
const { get } = require('@vue/cli-shared-utils')
const { toString } = require('webpack-chain')
const { highlight } = require('cli-highlight')
const config = api.resolveWebpackConfig()
const { _: paths, verbose } = args
@@ -48,7 +49,7 @@ module.exports = (api, options) => {
}
const output = toString(res, { verbose })
console.log(output)
console.log(highlight(output, { language: 'js' }))
// Log explanation for Nameless Rules
if (hasUnnamedRule) {
+1
View File
@@ -38,6 +38,7 @@
"cache-loader": "^2.0.1",
"case-sensitive-paths-webpack-plugin": "^2.2.0",
"chalk": "^2.4.2",
"cli-highlight": "^2.1.0",
"clipboardy": "^2.0.0",
"cliui": "^5.0.0",
"copy-webpack-plugin": "^4.6.0",
+12 -1
View File
@@ -4234,6 +4234,17 @@ cli-highlight@^1.2.3:
parse5 "^3.0.3"
yargs "^10.0.3"
cli-highlight@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/cli-highlight/-/cli-highlight-2.1.0.tgz#1e2e6770b6c3d72c4c7d4e5ea27c496f82ec2c67"
integrity sha512-DxaFAFBGRaB+xueXP7jlJC5f867gZUZXz74RaxeZ9juEZM2Sm/s6ilzpz0uxKiT+Mj6TzHlibtXfG/dK5bSwDA==
dependencies:
chalk "^2.3.0"
highlight.js "^9.6.0"
mz "^2.4.0"
parse5 "^4.0.0"
yargs "^11.0.0"
cli-spinners@^0.1.2:
version "0.1.2"
resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-0.1.2.tgz#bb764d88e185fb9e1e6a2a1f19772318f605e31c"
@@ -12555,7 +12566,7 @@ parse-url@^5.0.0:
parse-path "^4.0.0"
protocols "^1.4.0"
parse5@4.0.0:
parse5@4.0.0, parse5@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/parse5/-/parse5-4.0.0.tgz#6d78656e3da8d78b4ec0b906f7c08ef1dfe3f608"
integrity sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA==