Fix the build

This commit is contained in:
Pieter Vander Vennet 2023-01-17 03:37:26 +01:00
parent fd30c44352
commit e1791d3acb
3 changed files with 54 additions and 113 deletions

View file

@ -22,6 +22,20 @@ if [ $? -ne 0 ]; then
exit 1
fi
SRC_MAPS=""
BRANCH=`git rev-parse --abbrev-ref HEAD`
echo "The branch name is $BRANCH"
if [ $BRANCH = "develop" ]
then
SRC_MAPS="--sourcemap"
echo "Source maps are enabled"
fi
vite build $SRC_MAPS
# 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/
@ -30,27 +44,3 @@ cp -r assets/templates/ dist/assets/templates/
cp -r assets/tagRenderings/ dist/assets/tagRenderings/
cp assets/*.png dist/assets/
cp assets/*.svg dist/assets/
echo -e "\n\n Building non-theme pages"
echo -e " ==========================\n\n"
vite build "index.html" "404.html" "professional.html" "automaton.html" "import_helper.html" "import_viewer.html" "land.html" "customGenerator.html" "theme.html" vendor
if [ $? -ne 0 ]; then
echo "ERROR - stopping the build"
exit 1
fi
echo -e "\n\n Building theme pages"
echo -e " ======================\n\n"
for file in index_*.ts
do
theme=${file:6:-3}
echo -e "\n\n $theme"
echo -e " ------------ \n\n"
# Builds the necessary files for just one theme, e.g. 'bookcases.html' + 'index_bookcases.ts' + supporting file
vite build './' "$theme.html"
if [ $? -ne 0 ]; then
echo "ERROR - stopping the build"
exit 1
fi
done