From cfb064f400df092e48b97d501db28dbe90af7ee0 Mon Sep 17 00:00:00 2001 From: pietervdvn Date: Wed, 22 Dec 2021 02:10:02 +0100 Subject: [PATCH] Create assets file --- scripts/build.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/scripts/build.sh b/scripts/build.sh index 3fca6e61d1..2656520d68 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -6,18 +6,27 @@ echo "Starting build.Should" rm -rf dist/* rm -rf .cache mkdir dist 2> /dev/null +mkdir dist/assets 2> /dev/null # 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/ +echo "\n\n Building non-theme pages" +echo " ==========================\n\n" parcel build --no-source-maps --public-url ./ "index.html" "404.html" "professional.html" "automaton.html" "land.html" "customGenerator.html" "theme.html" vendor +echo "\n\n Building theme pages" +echo " ======================\n\n" for file in $(ls index_*.ts) do theme=${file:6:-3} - echo $theme + echo "\n\n $theme" + echo " ------------ \n\n" # Builds the necessary files for just one theme, e.g. 'bookcases.html' + 'index_bookcases.ts' + supporting file # npm run generate && node --max_old_space_size=12000 $(which parcel) build parcel build --no-source-maps --public-url ./ "$theme.html" -done \ No newline at end of file +done + +# Optimize images +cd dist/ && find -name '*.png' -exec optipng '{}' \; && echo 'PNGs are optimized' \ No newline at end of file