kanidm/server/web_ui/individual_build.sh
James Hodgkinson e02328ae8b
Splitting the SPAs (#2219)
* doing some work for enumerating how the accounts work together
* fixing up build scripts and removing extra things
* making JavaScript as_tag use the struct field names
* making shared.js a module, removing wasmloader.js
* don't compress compressed things
2023-10-27 06:03:58 +00:00

45 lines
1.1 KiB
Bash
Executable file

#!/bin/bash
set -e
if [ ! -f ../individual_build.sh ]; then
echo "Please run from the package base directory!"
exit 1
fi
if [ -z "${BUILD_FLAGS}" ]; then
BUILD_FLAGS="--release"
fi
if [ -z "$(which rsync)" ]; then
echo "Cannot find rsync which is needed to move things around, quitting!"
exit 1
fi
if [ -z "$(which wasm-pack)" ]; then
echo "Cannot find wasm-pack which is needed to build the UI, quitting!"
exit 1
fi
mkdir -p ./pkg
echo "Cleaning up WASM files before build..."
find ./pkg/ -name 'kanidmd*' -exec rm "{}" \;
# we can disable this since we want it to expand
# shellcheck disable=SC2086
wasm-pack build ${BUILD_FLAGS} --no-typescript --target web --mode no-install --no-pack
echo "######################"
echo "Moving files around..."
echo "######################"
touch ./pkg/ANYTHING_HERE_WILL_BE_DELETED_ADD_TO_SRC && \
rm ./pkg/.gitignore
echo "######################"
echo "Moving files up into the webui pkg dir..."
echo "######################"
rsync -av pkg/* ../pkg/
echo "######################"
echo " Done!"
echo "######################"