Skip to content

Commit

Permalink
fix(dev-utils): refactor hotDevClient to ES5 compat
Browse files Browse the repository at this point in the history
  • Loading branch information
Army-U committed Jan 9, 2019
1 parent 6948539 commit 1b6885d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
9 changes: 2 additions & 7 deletions core/dev-utils/formatWebpackMessages.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
// Some custom utilities to prettify Webpack output.
// This is quite hacky and hopefully won't be needed when Webpack fixes this.
// https://github.com/webpack/webpack/issues/2878

var chalk = require('chalk');

var friendlySyntaxErrorLabel = 'Syntax error:';

function isLikelyASyntaxError(message) {
Expand Down Expand Up @@ -69,12 +66,10 @@ function formatMessage(message, isError) {
lines[1] = lines[1].replace(exportError, '$1 \'$4\' does not contain an export named \'$3\'.');
}

lines[0] = chalk.inverse(lines[0]);

// Reassemble the message.
message = lines.map(line => {
message = lines.map(function (line) {
if (line.indexOf('vue-template-compiler must be installed as a peer dependency') > -1) {
return `You need to install "vue-template-compiler" alongside "vue" in your project.`
return 'You need to install "vue-template-compiler" alongside "vue" in your project.'
}
return line
}).join('\n');
Expand Down
2 changes: 1 addition & 1 deletion core/dev-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"opn": "^5.4.0",
"react-error-overlay": "^4.0.1",
"sockjs-client": "^1.1.5",
"strip-ansi": "^4.0.0"
"strip-ansi": "3.0.0"
},
"xo": false
}
7 changes: 7 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11647,6 +11647,13 @@ stringify-object@^3.2.2, stringify-object@^3.3.0:
is-obj "^1.0.1"
is-regexp "^1.0.0"

[email protected]:
version "3.0.0"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.0.tgz#7510b665567ca914ccb5d7e072763ac968be3724"
integrity sha1-dRC2ZVZ8qRTMtdfgcnY6yWi+NyQ=
dependencies:
ansi-regex "^2.0.0"

strip-ansi@^3.0.0, strip-ansi@^3.0.1:
version "3.0.1"
resolved "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf"
Expand Down

0 comments on commit 1b6885d

Please sign in to comment.