2018-10-28 22:01:09 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
BASEDIR=$(dirname "$0")
|
|
|
|
cd "$BASEDIR"
|
2018-10-28 22:59:15 +00:00
|
|
|
source ../scripts/resolve_commands.sh
|
2018-10-28 22:01:09 +00:00
|
|
|
|
2019-08-30 21:06:39 +00:00
|
|
|
if [[ ! -e declarations/imports_shared.d.ts ]]; then
|
2018-10-28 22:01:09 +00:00
|
|
|
echo "generate the declarations first!"
|
|
|
|
echo "Execute: /scripts/build_declarations.sh"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2019-08-30 21:06:39 +00:00
|
|
|
if [[ ! -e ../shared/generated/shared.js ]]; then
|
2018-10-28 22:01:09 +00:00
|
|
|
echo "generate the shared packed file first!"
|
|
|
|
echo "Execute: /shared/generate_packed.sh"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2018-10-28 22:59:15 +00:00
|
|
|
execute_tsc -p tsconfig/tsconfig_packed.json
|
2019-08-30 21:06:39 +00:00
|
|
|
if [[ $? -ne 0 ]]; then
|
2018-10-28 22:01:09 +00:00
|
|
|
echo "Failed to build file"
|
|
|
|
exit 1
|
2019-05-21 16:15:02 +00:00
|
|
|
fi
|
|
|
|
|
2019-08-30 21:06:39 +00:00
|
|
|
echo "Merging files"
|
2019-05-21 16:15:02 +00:00
|
|
|
|
2019-08-30 21:06:39 +00:00
|
|
|
if [[ -e generated/client.js ]]; then
|
2019-05-21 16:15:02 +00:00
|
|
|
rm generated/client.js
|
|
|
|
fi
|
|
|
|
cat ../shared/generated/shared.js > generated/client.js
|
|
|
|
cat generated/web.js >> generated/client.js
|
|
|
|
|
2019-08-30 21:06:39 +00:00
|
|
|
if [[ -e generated/client.min.js ]]; then
|
|
|
|
rm generated/client.min.js
|
|
|
|
fi
|
|
|
|
|
|
|
|
npm run minify-web-rel-file `pwd`/generated/client.min.js `pwd`/generated/client.js
|