Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Feb 1, 2023. It is now read-only.

Commit df5ff25

Browse files
marsbalrampariyarath
authored andcommitted
Runtime vars compatibility with split bundles (mars#133)
* Runtime vars compatibility with split bundles * 📚 split bundle compatibility * Upgrade inner buildpack for split bundle compatibility
1 parent a4a7cb5 commit df5ff25

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

‎.buildpacks‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
https://github.com/heroku/heroku-buildpack-nodejs.git
2-
https://github.com/mars/create-react-app-inner-buildpack.git#v6.0.0
2+
https://github.com/mars/create-react-app-inner-buildpack.git#v7.0.0
33
https://github.com/Airbase/heroku-buildpack-static

‎README.md‎

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Ensure [requirements](#user-content-requires) are met, then execute the followin
6363
✏️ *Replace `$APP_NAME` with the name for your unique app.*
6464

6565
```bash
66-
npx create-react-app@1.5.x $APP_NAME
66+
npx create-react-app@2.x $APP_NAME
6767
cd $APP_NAME
6868
git init
6969
heroku create $APP_NAME --buildpack mars/create-react-app
@@ -86,13 +86,12 @@ Usage
8686
✏️ *Replace `$APP_NAME` with the name for your unique app.*
8787

8888
```bash
89-
npx create-react-app@1.5.x $APP_NAME
89+
npx create-react-app@2.x $APP_NAME
9090
cd $APP_NAME
9191
```
9292

9393
* [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)
9494
* if [yarn](https://yarnpkg.com) is installed locally, the new app will use it instead of [npm](https://www.npmjs.com)
95-
* version 1.5.x is specified because [runtime env vars](#user-content-runtime-configuration) are not yet compatible with version 2.0.x ([issue #131](https://github.com/mars/create-react-app-buildpack/issues/131))
9695

9796
### Make it a git repo
9897

@@ -385,8 +384,6 @@ REACT_APP_HEROKU_SLUG_COMMIT=$HEROKU_SLUG_COMMIT react-scripts build
385384

386385
Supports only [`REACT_APP_`](https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md#adding-custom-environment-variables) prefixed variables.
387386

388-
🚨 *Not yet compatible with **Create React App 2** ([issue #131](https://github.com/mars/create-react-app-buildpack/issues/131))*
389-
390387
🚫🤐 ***Not for secrets.** These values may be accessed by anyone who can see the React app.*
391388

392389
Install the [runtime env npm package](https://www.npmjs.com/package/@mars/heroku-js-runtime-env):
@@ -423,10 +420,12 @@ If the javascript bundle location is customized, such as with an ejected created
423420
To solve this so the runtime can locate the bundle, set the custom bundle path:
424421

425422
```bash
426-
heroku config:set JS_RUNTIME_TARGET_BUNDLE=/app/my/custom/path/js/main.*.js
423+
heroku config:set JS_RUNTIME_TARGET_BUNDLE=/app/my/custom/path/js/*.js
427424
```
428425

429-
To unset this config and use the default path for **create-react-app**'s bundle, `/app/build/static/js/main.*.js`:
426+
✳️ *Note this path is a `*` glob, selecting multiple files, because as of create-react-app version 2 the [bundle is split](https://reactjs.org/blog/2018/10/01/create-react-app-v2.html).*
427+
428+
To unset this config and use the default path for **create-react-app**'s bundle, `/app/build/static/js/*.js`:
430429

431430
```bash
432431
heroku config:unset JS_RUNTIME_TARGET_BUNDLE

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /