Compile frontend when deploying
This commit is contained in:
parent
1c79cc890d
commit
45ac5276d4
2 changed files with 17 additions and 3 deletions
|
|
@ -17,6 +17,11 @@ def main [host: string, destination: string, ssh_key: path] {
|
||||||
scp ...$args
|
scp ...$args
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cd frontend
|
||||||
|
source frontend/deploy.nu
|
||||||
|
main true
|
||||||
|
cd ..
|
||||||
|
|
||||||
cargo test
|
cargo test
|
||||||
cargo build --target $target --release
|
cargo build --target $target --release
|
||||||
invoke_ssh [sudo systemctl stop recipes]
|
invoke_ssh [sudo systemctl stop recipes]
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,12 @@
|
||||||
wasm-pack build --target web
|
def main [release: bool = false] {
|
||||||
cp pkg/frontend.js ../backend/static
|
|
||||||
cp pkg/frontend_bg.wasm ../backend/static
|
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
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue