Skip to content
This repository was archived by the owner on Jan 13, 2025. It is now read-only.

Commit db68d9b

Browse files
authored
📚 update CRA link, use npx, clarify pushing from a branch
1 parent 0a48e8e commit db68d9b

File tree

1 file changed

+20
-11
lines changed

1 file changed

+20
-11
lines changed

README.md

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Heroku Buildpack for create-react-app
22
=====================================
33

4-
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).
4+
Deploy React.js web apps generated with [create-react-app](https://github.com/facebook/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
* 🚦 [Purpose](#user-content-purpose)
77
* ⚠️ [Requirements](#user-content-requires)
@@ -54,18 +54,16 @@ Requires
5454
* [a free account](https://signup.heroku.com)
5555
* [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
5656
* [Node.js](https://nodejs.org)
57-
* [create-react-app](https://github.com/facebookincubator/create-react-app)
58-
* `npm install -g create-react-app`
5957

6058
Quick Start
6159
-----------
6260

6361
Ensure [requirements](#user-content-requires) are met, then execute the following in a terminal.
6462

65-
✏️ *Replace `$APP_NAME` with a name for your unique app.*
63+
✏️ *Replace `$APP_NAME` with the name for your unique app.*
6664

6765
```bash
68-
create-react-app $APP_NAME
66+
npx create-react-app $APP_NAME
6967
cd $APP_NAME
7068
git init
7169
heroku create $APP_NAME --buildpack mars/create-react-app
@@ -85,11 +83,14 @@ Usage
8583

8684
### Generate a React app
8785

86+
✏️ *Replace `$APP_NAME` with the name for your unique app.*
87+
8888
```bash
89-
create-react-app my-app
90-
cd my-app
89+
npx create-react-app $APP_NAME
90+
cd $APP_NAME
9191
```
9292

93+
* [npx](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b) comes with npm 5.2+ and higher, see [instructions for older npm versions](https://gist.github.com/gaearon/4064d3c23a77c74a3614c498a8bb1c5f)
9394
* If [yarn](https://yarnpkg.com) is installed locally, the new app will use it instead of [npm](https://www.npmjs.com).
9495

9596
### Make it a git repo
@@ -102,17 +103,17 @@ At this point, this new repo is local, only on your computer. Eventually, you ma
102103

103104
### Create the Heroku app
104105

106+
✏️ *Replace `$APP_NAME` with the name for your unique app.*
107+
105108
```bash
106109
heroku create $APP_NAME --buildpack mars/create-react-app
107110
```
108111

109-
✏️ *Replace `$APP_NAME` with a name for your unique app.*
110-
111112
This command:
112113

113114
* sets the [app name](https://devcenter.heroku.com/articles/creating-apps#creating-a-named-app) & its URL `https://my-app-name.herokuapp.com`
114-
* sets the [buildpack](https://devcenter.heroku.com/articles/buildpacks) to deploy a `create-react-app` app
115-
* configures the [`heroku` remote](https://devcenter.heroku.com/articles/git#creating-a-heroku-remote) in the local git repo, so `git push heroku master` will push to this new Heroku app.
115+
* sets the app to use this [buildpack](https://devcenter.heroku.com/articles/buildpacks)
116+
* configures the [`heroku` git remote](https://devcenter.heroku.com/articles/git#creating-a-heroku-remote) in the local repo, so `git push heroku master` will push to this new Heroku app.
116117

117118
### Commit & deploy ♻️
118119

@@ -122,6 +123,14 @@ git commit -m "Start with create-react-app"
122123
git push heroku master
123124
```
124125

126+
…or if you are ever working on a branch other than `master`:
127+
128+
✏️ *Replace `$BRANCH_NAME` with the name for the current branch.*
129+
130+
```bash
131+
git push heroku $BRANCH_NAME:master
132+
```
133+
125134
### Visit the app's public URL in your browser
126135

127136
```bash

0 commit comments

Comments
 (0)