diff --git a/packages/react-scripts/bin/react-scripts.js b/packages/react-scripts/bin/react-scripts.js
index abb2741f854a3ed2d22112f5942555d9861ee959..1261de6be19af475a7f1c715a7323149817d9d04 100755
--- a/packages/react-scripts/bin/react-scripts.js
+++ b/packages/react-scripts/bin/react-scripts.js
@@ -11,8 +11,12 @@
 'use strict';
 
 const spawn = require('react-dev-utils/crossSpawn');
-const script = process.argv[2];
-const args = process.argv.slice(3);
+const args = process.argv.slice(2);
+
+const scriptIndex = args.findIndex(x =>
+   x === 'build' || x === 'eject' || x === 'start' || x === 'test');
+const script = scriptIndex === -1 ? args[0] : args[scriptIndex];
+const nodeArgs = scriptIndex > 0 ? args.slice(0, scriptIndex) : [];
 
 switch (script) {
   case 'build':
@@ -21,7 +25,9 @@ switch (script) {
   case 'test': {
     const result = spawn.sync(
       'node',
-      [require.resolve(`../scripts/${script}`)].concat(args),
+      nodeArgs
+        .concat(require.resolve('../scripts/' + script))
+        .concat(args.slice(scriptIndex + 1)),
       { stdio: 'inherit' }
     );
     if (result.signal) {