Skip to content
This repository was archived by the owner on Jun 11, 2022. It is now read-only.

Commit 6b6a152

Browse files
authored
📚 clarify NODE_ENV & other architecture details
1 parent 5ded51e commit 6b6a152

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -458,19 +458,24 @@ Architecture 🏙
458458
This buildpack combines several buildpacks, specified in [`.buildpacks`](.buildpacks), to support **zero-configuration deployment** on Heroku:
459459

460460
1. [`heroku/nodejs` buildpack](https://github.com/heroku/heroku-buildpack-nodejs)
461-
* installs complete `node`, puts it on the `$PATH`
461+
* installs `node`, puts on the `$PATH`
462462
* version specified in [`package.json`, `engines.node`](https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version)
463463
* `node_modules/` cached between deployments
464+
* `NODE_ENV` at buildtime:
465+
* defaults to `NODE_ENV=development` to install the build tooling of create-react-app's dev dependencies, like `react-scripts`
466+
* honors specific setting of `NODE_ENV`, like `NODE_ENV=test` for [automated testing](#user-content-testing) in [`bin/test`](bin/test)
467+
* but forces `NODE_ENV=production` to be `development` to ensure dev dependencies are available for build
464468
2. [`mars/create-react-app-inner-buildpack`](https://github.com/mars/create-react-app-inner-buildpack)
465469
* production build for create-react-app
466-
* generates the [default `static.json`](#user-content-web-server)
470+
* executes the package's build script; create-react-app default is `react-scripts build`
471+
* generates a production bundle regardless of `NODE_ENV` setting
472+
* sets default [web server config](#user-content-web-server) unless `static.json` already exists
467473
* enables [runtime environment variables](#user-content-environment-variables)
468474
3. [`heroku/static` buildpack](https://github.com/heroku/heroku-buildpack-static)
469475
* [Nginx](http://nginx.org/en/) web server
470-
* launches via `bin/boot`
471-
* configure via `static.json`; see [options specific to this buildpack](#user-content-web-server) and [all options](https://github.com/heroku/heroku-buildpack-static#configuration)
476+
* [configure with `static.json`](#user-content-web-server) (see [config static web server](https://github.com/heroku/heroku-buildpack-static#user-content-configuration)
472477

473-
Runtime processes are launched based on the last buildpack's default processes, the static buildpack's Nginx web server. Processes may be customized with a [Procfile](#user-content-procfile).
478+
🚀 The runtime `web` process is the [last buildpack](https://github.com/mars/create-react-app-buildpack/blob/master/.buildpacks)'s default processes. heroku-buildpack-static uses [`bin/boot`](https://github.com/heroku/heroku-buildpack-static/blob/master/bin/release) to launch its Nginx web server. Processes may be customized by committing a [Procfile](#user-content-procfile) to the app.
474479
475480
476481
### General-purpose SPA deployment

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy