-
-
Notifications
You must be signed in to change notification settings - Fork 27k
Allow to configure some behaviour for react-scripts start script #3915
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
clearConsole(); | ||
} | ||
console.log(chalk.cyan('Starting the development server...\n')); | ||
openBrowser(urls.localUrlForBrowser); | ||
if (!process.env.NO_OPEN_BROWSER) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think you can set env variable BROWSER=none
for this? https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md#advanced-configuration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wow, didn't know that, thanks! 😄
@@ -106,11 +106,13 @@ checkBrowsers(paths.appPath) | |||
if (err) { | |||
return console.log(err); | |||
} | |||
if (isInteractive) { | |||
if (isInteractive && !process.env.NO_CLEAR_CONSOLE) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is a way to achieve the same functionality right now, but not too pretty #2495 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks again! 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
watch #3288 for existing PR with the same functionality if you want it using env variable :)
3ded3c7
to
562284b
Compare
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed. If you have received this in error or have any questions, please contact us at [email protected]. Thanks! |
Closing PR since it's already solved, thanks @viankakrisna ! |
happy to help! |
Where is this already solved? |
This PR adds 2 new environment variables for configuring some behaviour in the
react-scripts start
script:NO_CLEAR_CONSOLE
andNO_OPEN_BROWSER
.The motivation behind these changes is to improve the experience executing
create-react-app
in environments where there's not a browser installed, like in a docker container.Also, clearing the console might prevent to see the output generated by other containers.