📚 revise build docs for heroku-postbuild

This commit is contained in:
Mars Hall
2017-02-08 09:06:19 -08:00
committed by GitHub
parent 3e34059697
commit 8498a59056

View File

@@ -11,8 +11,8 @@ To deploy a frontend-only React app, use the static-site optimized
A combo of two npm projects, the backend and the frontend. So there are two `package.json` configs.
1. [`package.json`](package.json) for [Node server](server/) & [Heroku deploy](https://devcenter.heroku.com/categories/deployment)
* `postinstall` script builds the React UI webpack bundle
* `cacheDirectories` includes `react-ui/node_modules/` to optimize deploy to Heroku
* `heroku-postbuild` script compiles the webpack bundle during deploy
* `cacheDirectories` includes `react-ui/node_modules/` to optimize build time
2. [`react-ui/package.json`](react-ui/package.json) for [React web UI](react-ui/)
* generated by [create-react-app](https://github.com/facebookincubator/create-react-app)
@@ -38,7 +38,7 @@ This deployment will automatically:
* detect [Node buildpack](https://elements.heroku.com/buildpacks/heroku/heroku-buildpack-nodejs)
* build the app with
* `npm install` for the Node server
* `postinstall` to build the webpack bundle from create-react-app
* `heroku-postbuild` for create-react-app
* launch the web process with `npm start`
* serves `../react-ui/build/` as static files
* customize by adding API, proxy, or route handlers/redirectors