Skip to content

Commit 0f9b5df

Browse files
committed
Pass showInstructions as an argument
1 parent 38bc01c commit 0f9b5df

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

packages/react-scripts/scripts/start.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,10 @@ function run(port) {
4949
var host = process.env.HOST || 'localhost';
5050

5151
// Create a webpack compiler that is configured with custom messages.
52-
var compiler = createWebpackCompiler(config, function onReady() {
52+
var compiler = createWebpackCompiler(config, function onReady(showInstructions) {
53+
if (!showInstructions) {
54+
return;
55+
}
5356
console.log();
5457
console.log('The app is running at:');
5558
console.log();

packages/react-scripts/scripts/utils/createWebpackCompiler.js

+4-6
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ if (isSmokeTest) {
1919
};
2020
}
2121

22-
module.exports = function createCompiler(config, onReadyCallback) {
22+
module.exports = function createWebpackCompiler(config, onReadyCallback) {
2323
// "Compiler" is a low-level interface to Webpack.
2424
// It lets us listen to some events and provide our own custom messages.
2525
try {
@@ -63,12 +63,10 @@ module.exports = function createCompiler(config, onReadyCallback) {
6363
console.log(chalk.green('Compiled successfully!'));
6464
}
6565

66-
if (showInstructions) {
67-
if (typeof onReadyCallback === 'function') {
68-
onReadyCallback();
69-
}
70-
isFirstCompile = false;
66+
if (typeof onReadyCallback === 'function') {
67+
onReadyCallback(showInstructions);
7168
}
69+
isFirstCompile = false;
7270

7371
// If errors exist, only show errors.
7472
if (messages.errors.length) {

0 commit comments

Comments
 (0)