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

Commit f81fbdf

Browse files
authored
Runtime vars compatibility with split bundles (#133)
* Runtime vars compatibility with split bundles * 📚 split bundle compatibility * Upgrade inner buildpack for split bundle compatibility
1 parent f2368a6 commit f81fbdf

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/heroku/heroku-buildpack-static.git

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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy