Initial commit
This commit is contained in:
18
scripts/build.sh
Normal file
18
scripts/build.sh
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
export REACT_APP_API_URL="${REACT_APP_API_URL:-}"
|
||||
|
||||
if command -v git >/dev/null 2>&1 && git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
|
||||
export REACT_APP_GIT_SHA="$(git rev-parse --short HEAD 2>/dev/null || true)"
|
||||
fi
|
||||
|
||||
NODE_MAJOR="$(node -p "process.versions.node.split('.')[0]")"
|
||||
|
||||
# CRA 4 + webpack 4 on Node 17+ need legacy OpenSSL; pass flag on the CLI (not NODE_OPTIONS).
|
||||
if [ "$NODE_MAJOR" -ge 17 ]; then
|
||||
exec node --openssl-legacy-provider ./node_modules/react-app-rewired/bin/index.js build
|
||||
fi
|
||||
|
||||
exec yarn build
|
||||
Reference in New Issue
Block a user