Files
Shahoo/scripts/build.sh
2026-08-13 20:26:04 +03:30

18 lines
548 B
Bash

#!/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