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

Commit

Permalink
Set NODE_ENV to support build with npm & Yarn. (#24)
Browse files Browse the repository at this point in the history
Set `NODE_ENV` to support build yarn.
  • Loading branch information
mars authored Jan 5, 2017
1 parent 30dbbc3 commit 79be6ea
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 5 deletions.
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

0 comments on commit 79be6ea

Please sign in to comment.