dnote/pkg/server/assets/styles/build.sh
Sung Won Cho 5bba57fd29
Remove dependency on packr (#597)
* Embed files

* Build CLI

* Remove packr

* Embed view directory

* Embed static files

* Make view engine

* Populate build info
2022-05-09 20:34:23 +10:00

24 lines
449 B
Bash
Executable file

#!/usr/bin/env bash
# build.sh builds styles
set -ex
dir=$(dirname "${BASH_SOURCE[0]}")
serverDir="$dir/../.."
outputDir="$serverDir/assets/static"
inputDir="$dir/src"
rm -rf "${outputDir:?}/*"
"$dir/../node_modules/.bin/sass" --version
task="$dir/../node_modules/.bin/sass \
--style compressed \
--source-map \
$inputDir:$outputDir"
# compile first then watch
eval "$task"
if [[ "$1" == "true" ]]; then
eval "$task --watch --poll"
fi