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

Commit 79be6ea

Browse files
authored
Set NODE_ENV to support build with npm & Yarn. (#24)
Set `NODE_ENV` to support build yarn.
1 parent 30dbbc3 commit 79be6ea

File tree

2 files changed

+30
-5
lines changed

2 files changed

+30
-5
lines changed

README.md

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ Heroku Buildpack for create-react-app
44
Deploy React.js web apps generated with [create-react-app](https://github.com/facebookincubator/create-react-app). Automates deployment with the built-in bundler and serves it up via [Nginx](http://nginx.org/en/). See the [introductory blog post](https://blog.heroku.com/deploying-react-with-zero-configuration) and entry in [Heroku elements](https://elements.heroku.com/buildpacks/mars/create-react-app-buildpack).
55

66
* ⚠️ [Requirements](#requires)
7-
* 🚀 [Usage](#usage)
7+
* 🚀 [Quick Start](#quick-start)
8+
* [Usage](#usage)
89
1. [Generate a React app](#generate-a-react-app)
910
1. [Make it a git repo](#make-it-a-git-repo)
1011
1. [Create the Heroku app](#create-the-heroku-app)
@@ -37,6 +38,26 @@ Requires
3738
* [create-react-app](https://github.com/facebookincubator/create-react-app)
3839
* `npm install -g create-react-app`
3940

41+
Quick Start
42+
-----------
43+
44+
Ensure [requirements](#requires) are met, then execute the following in a terminal.
45+
46+
✏️ *Replace `$APP_NAME` with a name for your unique app.*
47+
48+
```bash
49+
create-react-app $APP_NAME
50+
cd $APP_NAME
51+
git init
52+
heroku create $APP_NAME --buildpack https://github.com/mars/create-react-app-buildpack.git
53+
git add .
54+
git commit -m "Start with create-react-app"
55+
git push heroku master
56+
heroku open
57+
```
58+
59+
For explanation about these steps, continue reading the next section.
60+
4061
Usage
4162
-----
4263

@@ -47,6 +68,8 @@ create-react-app my-app
4768
cd my-app
4869
```
4970

71+
* If [yarn](https://yarnpkg.com) is installed locally, the new app will use it instead of [npm](https://www.npmjs.com).
72+
5073
### Make it a git repo
5174

5275
```bash
@@ -58,10 +81,10 @@ At this point, this new repo is local, only on your computer. Eventually, you ma
5881
### Create the Heroku app
5982

6083
```bash
61-
heroku create $my-app-name --buildpack https://github.com/mars/create-react-app-buildpack.git
84+
heroku create $APP_NAME --buildpack https://github.com/mars/create-react-app-buildpack.git
6285
```
6386

64-
✏️ *Replace `$my-app-name` with a name for your unique app.*
87+
✏️ *Replace `$APP_NAME` with a name for your unique app.*
6588

6689
This command:
6790

@@ -73,7 +96,7 @@ This command:
7396

7497
```bash
7598
git add .
76-
git commit -m "react-create-app on Heroku"
99+
git commit -m "Start with create-react-app"
77100
git push heroku master
78101
```
79102

bin/compile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,10 @@ dir=$(mktemp -t buildpackXXXXX)
3232
rm -rf $dir
3333

3434
# Set env vars for the inner buildpacks in `.buildpacks`
35-
# * Install `npm build` tooling.
35+
# * install build tooling (devDependencies) with npm & Yarn
36+
# * used only during compile, as the runtime is a static web server
3637
export NPM_CONFIG_PRODUCTION=false
38+
export NODE_ENV=development
3739

3840
echo "=====> Downloading Buildpack: $url"
3941

0 commit comments

Comments
 (0)