Skip to content

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

Closed

Conversation

rarguelloF
Copy link

This PR adds 2 new environment variables for configuring some behaviour in the react-scripts start script: NO_CLEAR_CONSOLE and NO_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.

clearConsole();
}
console.log(chalk.cyan('Starting the development server...\n'));
openBrowser(urls.localUrlForBrowser);
if (!process.env.NO_OPEN_BROWSER) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

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) {
Copy link
Contributor

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)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks again! 😄

Copy link
Contributor

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 :)

@rarguelloF rarguelloF force-pushed the improve-docker-experience branch from 3ded3c7 to 562284b Compare January 24, 2018 22:34
@facebook-github-bot
Copy link

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!

@rarguelloF
Copy link
Author

Closing PR since it's already solved, thanks @viankakrisna !

@rarguelloF rarguelloF closed this Jan 24, 2018
@rarguelloF rarguelloF deleted the improve-docker-experience branch January 24, 2018 22:38
@viankakrisna
Copy link
Contributor

happy to help!

@corysimmons
Copy link

Where is this already solved?

@lock lock bot locked and limited conversation to collaborators Jan 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants