From b45dd7b91bd1e5171dfc9fcfb14d29eb829a3fd3 Mon Sep 17 00:00:00 2001 From: Luke Edwards Date: Tue, 15 May 2018 09:21:59 -0700 Subject: [PATCH] update require syntax --- index.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index b421bae..50789b8 100644 --- a/index.js +++ b/index.js @@ -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); @@ -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();