diff --git a/packages/react-scripts/README.md b/packages/react-scripts/README.md index fcac0315648..0aaf88986b5 100644 --- a/packages/react-scripts/README.md +++ b/packages/react-scripts/README.md @@ -23,6 +23,7 @@ which version of `react-scripts` this fork is built from. - Use [postcss-import](https://github.com/postcss/postcss-import) - Use [postcss-apply](https://github.com/pascalduez/postcss-apply) - A separate `build-server` script that makes a build to use in SSR (server side rendering) +- Show customized instructions how to run the production build bundle ## Development diff --git a/packages/react-scripts/package.json b/packages/react-scripts/package.json index 54ce5de0f8f..a2c11f68526 100644 --- a/packages/react-scripts/package.json +++ b/packages/react-scripts/package.json @@ -1,6 +1,6 @@ { "name": "sharetribe-scripts", - "version": "5.0.0", + "version": "5.0.1", "description": "Fork of facebookincubator/create-react-app@4.0.0 with some additional features.", "repository": { "type": "git", diff --git a/packages/react-scripts/scripts/build.js b/packages/react-scripts/scripts/build.js index de2ff505eb3..0261f49c5e4 100644 --- a/packages/react-scripts/scripts/build.js +++ b/packages/react-scripts/scripts/build.js @@ -40,7 +40,50 @@ const configFactory = require('../config/webpack.config'); const paths = require('../config/paths'); const checkRequiredFiles = require('react-dev-utils/checkRequiredFiles'); const formatWebpackMessages = require('react-dev-utils/formatWebpackMessages'); -const printHostingInstructions = require('react-dev-utils/printHostingInstructions'); + +// +// Sharetribe custom: override the default hosting instructions with FTW specific instructions. +// +// const printHostingInstructions = require('react-dev-utils/printHostingInstructions'); +// +function printHostingInstructions( + appPackage, + publicUrl, + publicPath, + buildFolder, + useYarn +) { + console.log(); + console.log(`The ${chalk.cyan(buildFolder)} folder is ready to be deployed.`); + console.log(); + console.log( + 'In local development machine you may serve it on production mode by running:' + ); + console.log(); + console.log(` NODE_ENV=production PORT=3000 ${chalk.cyan('yarn')} start`); + console.log(); + console.log( + 'In production server (e.g. Heroku) we recommend you to set the environment' + ); + console.log( + `variables ${chalk.cyan('NODE_ENV')} and ${chalk.cyan( + 'PORT' + )} using provider\'s own mechanism to manage` + ); + console.log('environment variables, and then start the app by running:'); + console.log(); + console.log(` ${chalk.cyan('yarn')} start`); + console.log(); + console.log('Find out more about environment variables and deployment here:'); + console.log(); + console.log( + ` ${chalk.yellow( + 'https://www.sharetribe.com/docs/ftw-hosting/how-to-deploy-ftw-to-production/' + )}` + ); + console.log(); +} + const FileSizeReporter = require('react-dev-utils/FileSizeReporter'); const printBuildError = require('react-dev-utils/printBuildError');