Skip to content

Commit a404843

Browse files
committed
Set browsers automatically if not an interactive terminal
1 parent 7c1e4f4 commit a404843

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Diff for: scripts/build.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ const useYarn = fs.existsSync(paths.yarnLockFile);
5151
const WARN_AFTER_BUNDLE_GZIP_SIZE = 512 * 1024;
5252
const WARN_AFTER_CHUNK_GZIP_SIZE = 1024 * 1024;
5353

54+
const isInteractive = process.stdout.isTTY;
55+
5456
// Warn and crash if required files are missing
5557
if (!checkRequiredFiles([paths.appHtml, paths.appIndexJs])) {
5658
process.exit(1);
@@ -63,7 +65,7 @@ const writeStatsJson = argv.indexOf('--stats') !== -1;
6365
// We require that you explictly set browsers and do not fall back to
6466
// browserslist defaults.
6567
const { checkBrowsers } = require('react-dev-utils/browsersHelper');
66-
checkBrowsers(paths.appPath)
68+
checkBrowsers(paths.appPath, isInteractive)
6769
.then(() => {
6870
// First, read the current file sizes in build directory.
6971
// This lets us display how much they changed later.

Diff for: scripts/start.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ if (process.env.HOST) {
7878
// We require that you explictly set browsers and do not fall back to
7979
// browserslist defaults.
8080
const { checkBrowsers } = require('react-dev-utils/browsersHelper');
81-
checkBrowsers(paths.appPath)
81+
checkBrowsers(paths.appPath, isInteractive)
8282
.then(() => {
8383
// We attempt to use the default port but if it is busy, we offer the user to
8484
// run on a different port. `choosePort()` Promise resolves to the next free port.

0 commit comments

Comments
 (0)