build(docker): use esbuild for JS compiling

This commit is contained in:
Oliver Davies 2021-12-28 16:04:07 +00:00
parent 29014d1c56
commit 3651d69ce1
5 changed files with 135 additions and 2 deletions

13
run
View file

@ -133,4 +133,17 @@ function task:yarn:build:css {
--output build/app.css "${args[@]}"
}
function task:yarn:build:js {
# Build JS assets, this is meant to be run from within the assets container.
local args=()
if [ "${NODE_ENV}" == "production" ]; then
args=(--minify)
else
args=(--sourcemap --watch)
fi
esbuild assets/js/*.* --outdir=build --bundle "${args[@]}"
}
eval "task:${@:-help}"