Skip to content

Commit

Permalink
Merge branch 'master' of github.com:facebookincubator/create-react-ap…
Browse files Browse the repository at this point in the history
…p into react-dev-utils/babel
  • Loading branch information
viankakrisna committed Jul 11, 2017
2 parents 7d3146b + 3690495 commit e726667
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions packages/react-dev-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"detect-port-alt": "1.1.3",
"escape-string-regexp": "1.0.5",
"filesize": "3.3.0",
"global-modules": "1.0.0",
"gzip-size": "3.0.0",
"html-entities": "1.2.1",
"inquirer": "3.1.1",
Expand Down
12 changes: 8 additions & 4 deletions packages/react-dev-utils/src/printHostingInstructions.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

const chalk = require('chalk');
const url = require('url');
const globalModules = require('global-modules');
const fs = require('fs');

function printHostingInstructions(
appPackage,
Expand Down Expand Up @@ -121,10 +123,12 @@ function printHostingInstructions(
);
console.log('You may serve it with a static server:');
console.log();
if (useYarn) {
console.log(` ${chalk.cyan('yarn')} global add serve`);
} else {
console.log(` ${chalk.cyan('npm')} install -g serve`);
if (!fs.existsSync(`${globalModules}/serve`)) {
if (useYarn) {
console.log(` ${chalk.cyan('yarn')} global add serve`);
} else {
console.log(` ${chalk.cyan('npm')} install -g serve`);
}
}
console.log(` ${chalk.cyan('serve')} -s ${buildFolder}`);
console.log();
Expand Down

0 comments on commit e726667

Please sign in to comment.