Compile frontend when deploying

This commit is contained in:
Greg Burri 2024-12-05 01:10:42 +01:00
parent 1c79cc890d
commit 45ac5276d4
2 changed files with 17 additions and 3 deletions

View file

@ -1,3 +1,12 @@
wasm-pack build --target web
cp pkg/frontend.js ../backend/static
cp pkg/frontend_bg.wasm ../backend/static
def main [release: bool = false] {
mut wasm_pack_args = [ build --target web ]
if $release {
$wasm_pack_args = $wasm_pack_args ++ [ --release ]
}
wasm-pack ...$wasm_pack_args
cp pkg/frontend.js ../backend/static
cp pkg/frontend_bg.wasm ../backend/static
}