You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Instead of just calling openBrowser, allow developers to pass in a script to kick off the start or open functionality. For example, this would be useful for use with electron development.
Proposed behavior
Inside: 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);
+ }
}
});
}
Activity
Resolve react#1095 - Add flexibility to the start script
gaearon commentedon Dec 5, 2016
I think #873 (and #1148) should cover this. It's not exactly the same solution but I think we can close this as a duplicate of #873.
license2e commentedon Dec 5, 2016
👍 Thank you!