Skip to content

Commit

Permalink
Pass showInstructions as an argument
Browse files Browse the repository at this point in the history
  • Loading branch information
Timer committed Mar 4, 2017
1 parent 38bc01c commit 0f9b5df
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
5 changes: 4 additions & 1 deletion packages/react-scripts/scripts/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ function run(port) {
var host = process.env.HOST || 'localhost';

// Create a webpack compiler that is configured with custom messages.
var compiler = createWebpackCompiler(config, function onReady() {
var compiler = createWebpackCompiler(config, function onReady(showInstructions) {
if (!showInstructions) {
return;
}
console.log();
console.log('The app is running at:');
console.log();
Expand Down
10 changes: 4 additions & 6 deletions packages/react-scripts/scripts/utils/createWebpackCompiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if (isSmokeTest) {
};
}

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

if (showInstructions) {
if (typeof onReadyCallback === 'function') {
onReadyCallback();
}
isFirstCompile = false;
if (typeof onReadyCallback === 'function') {
onReadyCallback(showInstructions);
}
isFirstCompile = false;

// If errors exist, only show errors.
if (messages.errors.length) {
Expand Down

0 comments on commit 0f9b5df

Please sign in to comment.