Skip to content

Commit

Permalink
Merge pull request #2 from mars/node-env-vars
Browse files Browse the repository at this point in the history
Support custom `NODE_*` env vars during build
  • Loading branch information
mars authored Sep 3, 2016
2 parents 792c9ff + e5c044a commit a92d75c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions bin/compile
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,12 @@ else
echo '{ "root": "build/" }' > static.json
fi

# Support custom `REACT_APP_*` env vars during build.
# https://github.com/facebookincubator/create-react-app/blob/v0.2.3/template/README.md#adding-custom-environment-variables
export_env_dir "$ENV_DIR" '^REACT_APP_'
# Support env vars during build:
# * `REACT_APP_*`
# * https://github.com/facebookincubator/create-react-app/blob/v0.2.3/template/README.md#adding-custom-environment-variables
# * `NODE_*`, especially for `NODE_PATH`
# * https://github.com/facebookincubator/create-react-app/pull/476
export_env_dir "$ENV_DIR" '^(REACT_APP_|NODE_)'

# Build the javascript bundle
npm run build

0 comments on commit a92d75c

Please sign in to comment.