diff --git a/packages/react-dev-utils/chalk.js b/packages/react-dev-utils/chalk.js new file mode 100644 index 00000000000..8c42148dd7b --- /dev/null +++ b/packages/react-dev-utils/chalk.js @@ -0,0 +1,12 @@ +/** + * Copyright (c) 2015-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict'; + +var chalk = require('chalk'); + +module.exports = chalk; diff --git a/packages/react-dev-utils/package.json b/packages/react-dev-utils/package.json index 3e5d75eabb7..56928396549 100644 --- a/packages/react-dev-utils/package.json +++ b/packages/react-dev-utils/package.json @@ -12,6 +12,7 @@ }, "files": [ "browsersHelper.js", + "chalk.js", "checkRequiredFiles.js", "clearConsole.js", "crossSpawn.js", diff --git a/packages/react-scripts/package.json b/packages/react-scripts/package.json index 0a94c39bd2d..687ecd34a7d 100644 --- a/packages/react-scripts/package.json +++ b/packages/react-scripts/package.json @@ -34,7 +34,6 @@ "babel-preset-react-app": "^7.0.0", "bfj": "6.1.1", "case-sensitive-paths-webpack-plugin": "2.1.2", - "chalk": "2.4.2", "css-loader": "1.0.0", "dotenv": "6.0.0", "dotenv-expand": "4.2.0", diff --git a/packages/react-scripts/scripts/build.js b/packages/react-scripts/scripts/build.js index 35cbfc15073..8cd1ad77ee5 100644 --- a/packages/react-scripts/scripts/build.js +++ b/packages/react-scripts/scripts/build.js @@ -32,7 +32,7 @@ verifyTypeScriptSetup(); // @remove-on-eject-end const path = require('path'); -const chalk = require('chalk'); +const chalk = require('react-dev-utils/chalk'); const fs = require('fs-extra'); const webpack = require('webpack'); const bfj = require('bfj'); diff --git a/packages/react-scripts/scripts/eject.js b/packages/react-scripts/scripts/eject.js index 3f850068668..a151bbd6e35 100644 --- a/packages/react-scripts/scripts/eject.js +++ b/packages/react-scripts/scripts/eject.js @@ -17,7 +17,7 @@ process.on('unhandledRejection', err => { const fs = require('fs-extra'); const path = require('path'); const execSync = require('child_process').execSync; -const chalk = require('chalk'); +const chalk = require('react-dev-utils/chalk'); const paths = require('../config/paths'); const createJestConfig = require('./utils/createJestConfig'); const inquirer = require('react-dev-utils/inquirer'); diff --git a/packages/react-scripts/scripts/init.js b/packages/react-scripts/scripts/init.js index 771f6dbf490..9b473ab3d95 100644 --- a/packages/react-scripts/scripts/init.js +++ b/packages/react-scripts/scripts/init.js @@ -16,7 +16,7 @@ process.on('unhandledRejection', err => { const fs = require('fs-extra'); const path = require('path'); -const chalk = require('chalk'); +const chalk = require('react-dev-utils/chalk'); const execSync = require('child_process').execSync; const spawn = require('react-dev-utils/crossSpawn'); const { defaultBrowsers } = require('react-dev-utils/browsersHelper'); diff --git a/packages/react-scripts/scripts/start.js b/packages/react-scripts/scripts/start.js index 7750c25a176..852e6b8fb44 100644 --- a/packages/react-scripts/scripts/start.js +++ b/packages/react-scripts/scripts/start.js @@ -32,7 +32,7 @@ verifyTypeScriptSetup(); // @remove-on-eject-end const fs = require('fs'); -const chalk = require('chalk'); +const chalk = require('react-dev-utils/chalk'); const webpack = require('webpack'); const WebpackDevServer = require('webpack-dev-server'); const clearConsole = require('react-dev-utils/clearConsole'); diff --git a/packages/react-scripts/scripts/utils/createJestConfig.js b/packages/react-scripts/scripts/utils/createJestConfig.js index 58c2ad48812..a5f1a1bd7b8 100644 --- a/packages/react-scripts/scripts/utils/createJestConfig.js +++ b/packages/react-scripts/scripts/utils/createJestConfig.js @@ -8,7 +8,7 @@ 'use strict'; const fs = require('fs'); -const chalk = require('chalk'); +const chalk = require('react-dev-utils/chalk'); const paths = require('../../config/paths'); module.exports = (resolve, rootDir, isEjecting) => { diff --git a/packages/react-scripts/scripts/utils/verifyPackageTree.js b/packages/react-scripts/scripts/utils/verifyPackageTree.js index 9b8a6a03486..075860eac5b 100644 --- a/packages/react-scripts/scripts/utils/verifyPackageTree.js +++ b/packages/react-scripts/scripts/utils/verifyPackageTree.js @@ -8,7 +8,7 @@ 'use strict'; -const chalk = require('chalk'); +const chalk = require('react-dev-utils/chalk'); const fs = require('fs'); const path = require('path'); diff --git a/packages/react-scripts/scripts/utils/verifyTypeScriptSetup.js b/packages/react-scripts/scripts/utils/verifyTypeScriptSetup.js index d8da57a3509..58c352c4464 100644 --- a/packages/react-scripts/scripts/utils/verifyTypeScriptSetup.js +++ b/packages/react-scripts/scripts/utils/verifyTypeScriptSetup.js @@ -8,7 +8,7 @@ 'use strict'; -const chalk = require('chalk'); +const chalk = require('react-dev-utils/chalk'); const fs = require('fs'); const resolve = require('resolve'); const path = require('path');