This commit is contained in:
Erik Michelson 2025-03-11 06:57:55 +01:00
parent 159a100b0d
commit efec25e4fb
No known key found for this signature in database
GPG key ID: DB99ADDDC5C0AF82
29 changed files with 25 additions and 1134 deletions

View file

@ -7,31 +7,10 @@
set -e
cleanup () {
if [ -d ../tmp/src/pages/api ]; then
echo "🦔 > Moving Mock API files back"
mv ../tmp/src/pages/api src/pages
fi
}
trap cleanup EXIT
echo "🦔 Frontend Production Build"
echo "🦔 > Clearing existing builds"
rm -rf dist/
echo "🦔 > Preparing files"
if [ ! -z "${NEXT_PUBLIC_USE_MOCK_API}" ]; then
echo "🦔 > Keeping Mock API because NEXT_PUBLIC_USE_MOCK_API is set"
if [ ! -d src/pages/api ]; then
echo "🦔 > ⚠️ src/pages/api doesn't exist"
fi
else
echo "🦔 > Moving Mock API because NEXT_PUBLIC_USE_MOCK_API is unset"
mkdir -p ../tmp/src/pages
mv src/pages/api ../tmp/src/pages/
fi
echo "🦔 > Building"
BUILD_TIME=true next build