Skip to content

Commit

Permalink
update require syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeed committed May 15, 2018
1 parent 3f65094 commit b45dd7b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions index.js
Expand Up @@ -3,9 +3,7 @@
* see: https://github.com/facebookincubator/create-react-app/tree/master/packages/react-dev-utils
*/

'use strict';

const colors = require('ansi-colors');
const { inverse } = require('ansi-colors');

const errorLabel = 'Syntax error:';
const isLikelyASyntaxError = str => str.includes(errorLabel);
Expand Down Expand Up @@ -55,7 +53,7 @@ function formatMessage(message, isError) {
lines[1] = lines[1].replace(exportRegex, "$1 '$4' does not contain an export named '$3'.");
}

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

// Reassemble & Strip internal tracing, except `webpack:` -- (create-react-app/pull/1050)
return lines.join('\n').replace(stackRegex, '').trim();
Expand Down

0 comments on commit b45dd7b

Please sign in to comment.