From 398f7260e61b64105252fc27ed88565afd10230d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pavol=20Mada=CC=81r?=
Date: Mon, 22 May 2017 07:53:58 +0200
Subject: [PATCH] Remove connect-history-api-fallback and cross-spawn
dependencies from react-scripts (#751)
---
packages/react-dev-utils/crossSpawn.js | 14 ++++++++++++++
packages/react-dev-utils/package.json | 1 +
packages/react-scripts/bin/react-scripts.js | 2 +-
packages/react-scripts/package.json | 2 --
packages/react-scripts/scripts/eject.js | 2 +-
packages/react-scripts/scripts/init.js | 2 +-
6 files changed, 18 insertions(+), 5 deletions(-)
create mode 100644 packages/react-dev-utils/crossSpawn.js
diff --git a/packages/react-dev-utils/crossSpawn.js b/packages/react-dev-utils/crossSpawn.js
new file mode 100644
index 00000000000..8424dcf090e
--- /dev/null
+++ b/packages/react-dev-utils/crossSpawn.js
@@ -0,0 +1,14 @@
+/**
+ * Copyright (c) 2015-present, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ */
+
+'use strict';
+
+var crossSpawn = require('cross-spawn');
+
+module.exports = crossSpawn;
diff --git a/packages/react-dev-utils/package.json b/packages/react-dev-utils/package.json
index 16eb847e8f5..ccd160971e1 100644
--- a/packages/react-dev-utils/package.json
+++ b/packages/react-dev-utils/package.json
@@ -15,6 +15,7 @@
"checkRequiredFiles.js",
"clearConsole.js",
"crashOverlay.js",
+ "crossSpawn.js",
"eslintFormatter.js",
"FileSizeReporter.js",
"formatWebpackMessages.js",
diff --git a/packages/react-scripts/bin/react-scripts.js b/packages/react-scripts/bin/react-scripts.js
index 7bf1e7503e2..cb52fe71b09 100755
--- a/packages/react-scripts/bin/react-scripts.js
+++ b/packages/react-scripts/bin/react-scripts.js
@@ -10,7 +10,7 @@
'use strict';
-const spawn = require('cross-spawn');
+const spawn = require('react-dev-utils/crossSpawn');
const script = process.argv[2];
const args = process.argv.slice(3);
diff --git a/packages/react-scripts/package.json b/packages/react-scripts/package.json
index 633b221ba96..3b6692fd088 100644
--- a/packages/react-scripts/package.json
+++ b/packages/react-scripts/package.json
@@ -30,8 +30,6 @@
"babel-runtime": "6.23.0",
"case-sensitive-paths-webpack-plugin": "1.1.4",
"chalk": "1.1.3",
- "connect-history-api-fallback": "1.3.0",
- "cross-spawn": "4.0.2",
"css-loader": "0.28.1",
"dotenv": "4.0.0",
"eslint": "3.19.0",
diff --git a/packages/react-scripts/scripts/eject.js b/packages/react-scripts/scripts/eject.js
index 796e6f63a05..c771e075d35 100644
--- a/packages/react-scripts/scripts/eject.js
+++ b/packages/react-scripts/scripts/eject.js
@@ -19,11 +19,11 @@ process.on('unhandledRejection', err => {
const fs = require('fs-extra');
const path = require('path');
const execSync = require('child_process').execSync;
-const spawnSync = require('cross-spawn').sync;
const chalk = require('chalk');
const paths = require('../config/paths');
const createJestConfig = require('./utils/createJestConfig');
const inquirer = require('react-dev-utils/inquirer');
+const spawnSync = require('react-dev-utils/crossSpawn').sync;
const green = chalk.green;
const cyan = chalk.cyan;
diff --git a/packages/react-scripts/scripts/init.js b/packages/react-scripts/scripts/init.js
index 87d87e621e7..a50704d1cf7 100644
--- a/packages/react-scripts/scripts/init.js
+++ b/packages/react-scripts/scripts/init.js
@@ -18,8 +18,8 @@ process.on('unhandledRejection', err => {
const fs = require('fs-extra');
const path = require('path');
-const spawn = require('cross-spawn');
const chalk = require('chalk');
+const spawn = require('react-dev-utils/crossSpawn');
module.exports = function(
appPath,