Skip to content

Commit 34df3e6

Browse files
committed
Remove .env
Replace %REACT_APP_ENV% with <noscript> to avoid having to add REACT_APP_ENV placeholder to .env file during development.
1 parent 66f1a5c commit 34df3e6

File tree

3 files changed

+2
-5
lines changed

3 files changed

+2
-5
lines changed

Diff for: .env

-1
This file was deleted.

Diff for: docker-entrypoint.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ ENV_JSON="$(jq --compact-output --null-input 'env | with_entries(select(.key | s
99
# Inside of JSON strings newlines are already escaped.
1010
ENV_JSON_ESCAPED="$(printf "%s" "${ENV_JSON}" | sed -e 's/[\&/]/\\&/g')"
1111

12-
sed -i "s/%REACT_APP_ENV%/${ENV_JSON_ESCAPED}/g" /var/www/index.html
12+
sed -i "s/<noscript id=\"env-insertion-point\"><\/noscript>/<script>var ENV=${ENV_JSON_ESCAPED}<\/script>/g" /var/www/index.html
1313

1414
exec "$@"

Diff for: public/index.html

+1-3
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@
2323
Learn how to configure a non-root public URL by running `npm run build`.
2424
-->
2525

26-
<script>
27-
var ENV = %REACT_APP_ENV%;
28-
</script>
26+
<noscript id="env-insertion-point"></noscript>
2927

3028
<title>React App</title>
3129
</head>

0 commit comments

Comments
 (0)