From 8356b671decbe051e3a728d4d99515722a5969a0 Mon Sep 17 00:00:00 2001 From: Ilya Shindyapin Date: Thu, 24 Nov 2016 10:07:18 -0700 Subject: [PATCH] Resolve #1095 - Add flexibility to the start script Signed-off-by: Ilya Shindyapin --- packages/react-scripts/scripts/start.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/react-scripts/scripts/start.js b/packages/react-scripts/scripts/start.js index 752bd8a08a8..a422763ea15 100644 --- a/packages/react-scripts/scripts/start.js +++ b/packages/react-scripts/scripts/start.js @@ -279,7 +279,15 @@ function runDevServer(host, port, protocol) { console.log(); if (isInteractive) { - openBrowser(protocol + '://' + host + ':' + port + '/'); + var devUrl = protocol + '://' + host + ':' + port + '/'; + var startScriptPath = require(paths.appPackageJson).startScript || false; + if (startScriptPath) { + var path = require('path'); + process.env.DEV_URL = devUrl; + require(path.join(process.cwd(), startScriptPath)); + } else { + openBrowser(devUrl); + } } }); }