Skip to content

Commit 8356b67

Browse files
committed
Resolve facebook#1095 - Add flexibility to the start script
Signed-off-by: Ilya Shindyapin <[email protected]>
1 parent dc6edce commit 8356b67

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

packages/react-scripts/scripts/start.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,15 @@ function runDevServer(host, port, protocol) {
279279
console.log();
280280

281281
if (isInteractive) {
282-
openBrowser(protocol + '://' + host + ':' + port + '/');
282+
var devUrl = protocol + '://' + host + ':' + port + '/';
283+
var startScriptPath = require(paths.appPackageJson).startScript || false;
284+
if (startScriptPath) {
285+
var path = require('path');
286+
process.env.DEV_URL = devUrl;
287+
require(path.join(process.cwd(), startScriptPath));
288+
} else {
289+
openBrowser(devUrl);
290+
}
283291
}
284292
});
285293
}

0 commit comments

Comments
 (0)