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

Set NODE_ENV to support build yarn. #24

Merged
merged 3 commits into from
Jan 5, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 27 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ Heroku Buildpack for create-react-app
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).

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

Quick Start
-----------

Ensure [requirements](#requires) are met, then execute the following in a terminal.

✏️ *Replace `$APP_NAME` with a name for your unique app.*

```bash
create-react-app $APP_NAME
cd $APP_NAME
git init
heroku create $APP_NAME --buildpack https://github.com/mars/create-react-app-buildpack.git
git add .
git commit -m "Start with create-react-app"
git push heroku master
heroku open
```

For explanation about these steps, continue reading the next section.

Usage
-----

Expand All @@ -47,6 +68,8 @@ create-react-app my-app
cd my-app
```

* If [yarn](https://yarnpkg.com) is installed locally, the new app will use it instead of [npm](https://www.npmjs.com).

### Make it a git repo

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

```bash
heroku create $my-app-name --buildpack https://github.com/mars/create-react-app-buildpack.git
heroku create $APP_NAME --buildpack https://github.com/mars/create-react-app-buildpack.git
```

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

This command:

Expand All @@ -73,7 +96,7 @@ This command:

```bash
git add .
git commit -m "react-create-app on Heroku"
git commit -m "Start with create-react-app"
git push heroku master
```

Expand Down
4 changes: 3 additions & 1 deletion bin/compile
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ dir=$(mktemp -t buildpackXXXXX)
rm -rf $dir

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

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

Expand Down