From e6bbb62c07ca817ca363a2778f11d17491d172ee Mon Sep 17 00:00:00 2001 From: Paul van Tilburg Date: Tue, 14 Jul 2020 16:51:16 +0200 Subject: [PATCH] Replace cargo-web by wasm-pack in build-ui task; drop copy-wasm-assets task --- Makefile.toml | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/Makefile.toml b/Makefile.toml index 4f6d752..614e5ac 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -5,37 +5,28 @@ workspace = false clear = true workspace = false category = "Build" -description = "Runs the rust compiler for both server and UI" +description = "Runs the Rust compiler for both server and UI" dependencies = ["build-server", "build-ui"] [tasks.build-server] category = "Build" -description = "Runs the rust compiler for the server" +description = "Runs the Rust compiler for the server" command = "cargo" args = ["build", "-p", "stoptime_server"] [tasks.build-ui] category = "Build" -description = "Runs the rust compiler via cargo-web for the UI" -install-crate = "cargo-web" -command = "cargo" -args = ["web", "build", "-p", "stoptime_ui", "--target", "wasm32-unknown-unknown"] - -[tasks.copy-wasm-assets] -description = "Copies the WASM assets generated by cargo-web to the static assets directory" -command = "cp" -args = [ - "target/wasm32-unknown-unknown/debug/stoptime_ui.js", - "target/wasm32-unknown-unknown/debug/stoptime_ui.wasm", - "ui/static" -] -dependencies = ["build-ui"] +description = "Runs the Rust compiler via wasm-pack for the UI" +install-crate = "wasm-pack" +command = "wasm-pack" +args = ["build", "--out-name", "stoptime_ui", "--out-dir", "static", "--target", "web"] +cwd = "ui" [tasks.run] clear = true workspace = false description = "Runs the server" -dependencies = ["copy-wasm-assets"] +dependencies = ["build"] command = "cargo" args = ["run", "-p", "stoptime_server"]