ucs/bundle.sh
2025-03-14 10:44:43 +02:00

27 lines
442 B
Bash
Executable File

#!/usr/bin/bash
set -e -u -o pipefail
# Build frontend
cd frontend
npm install
npm run build
(cd dist/assets && mv *.js ucs.js && mv *.css ucs.css)
cd ..
# Build backend
cd backend
npm install
cp ../frontend/dist/assets/* public/
# Bundle
PACKAGE="ucs-$(cat package.json | jq -r .version).tar.gz"
tar czvf "$PACKAGE" package.json package-lock.json main.mjs node_modules/ public/
cd ..
mv backend/"$PACKAGE" .
echo "$PACKAGE created."