mapcomplete/scripts/build.sh

31 lines
842 B
Bash
Raw Normal View History

#! /usr/bin/env bash
2022-01-08 19:15:56 +01:00
echo "Starting build"
# The build script; we build the application step by step as building everything at once takes too much RAM
# Should be run from the repository root
2022-01-08 19:15:56 +01:00
# This is the main deployment script
2023-11-13 15:22:23 +01:00
# sanity check
if [[ -f "bookcases.html" ]]
then
2023-11-13 15:44:32 +01:00
echo "Bookcases exists"
2023-11-13 15:22:23 +01:00
else
echo "Bookcases.html does not exist - aborting"
exit 1
fi
2023-12-02 03:17:40 +01:00
export NODE_OPTIONS=--max-old-space-size=16000
2023-10-30 13:45:44 +01:00
which vite
vite --version
vite build --sourcemap || { echo 'Vite build failed' ; exit 1; }
# Copy the layer files, as these might contain assets (e.g. svgs)
cp -r assets/layers/ dist/assets/layers/
cp -r assets/themes/ dist/assets/themes/
cp -r assets/svg/ dist/assets/svg/
2023-10-11 03:47:23 +02:00
mkdir dist/assets/langs
mkdir dist/assets/langs/layers
2023-10-11 04:09:18 +02:00
cp -r langs/layers/ dist/assets/langs/
ls dist/assets/langs/layers/
2023-02-16 18:18:40 +01:00
export NODE_OPTIONS=""