diff --git a/Makefile b/Makefile index 5b07e16..7cda5e4 100644 --- a/Makefile +++ b/Makefile @@ -18,11 +18,17 @@ kitchen: wasm kitchen/src/*.rs release: wasmrelease cd kitchen; cargo build --release -wasmrelease: web/index.html web/src/*.rs web/src/components/*.rs - cd web; trunk build --release --public-url /ui/ +static-prep: web/index.html web/static/*.css + mkdir -p web/dist + cp -r web/index.html web/dist/ + cp -r web/static web/dist/ -wasm: web/index.html web/src/*.rs web/src/components/*.rs - cd web; trunk build --public-url /ui/ +wasmrelease: static-prep web/src/*.rs web/src/components/*.rs + cd web; wasm-pack build --release --target web --out-dir dist/ + +wasm: static-prep web/src/*.rs web/src/components/*.rs + cd web; wasm-pack build --target web --out-dir dist/ clean: - rm -rf web/dist/* \ No newline at end of file + rm -rf web/dist/* + cargo clean \ No newline at end of file diff --git a/flake.nix b/flake.nix index 93b089a..7ce58bc 100644 --- a/flake.nix +++ b/flake.nix @@ -58,7 +58,7 @@ program = "${kitchen}/bin/kitchen"; }; devShell = pkgs.mkShell { - buildInputs = [ rust-wasm ] ++ (with pkgs; [wasm-bindgen-cli wasm-pack]); + buildInputs = [ rust-wasm ] ++ (with pkgs; [wasm-bindgen-cli wasm-pack httplz]); }; } ); diff --git a/nix/kitchenWasm/default.nix b/nix/kitchenWasm/default.nix index ff9adec..8a7bebb 100644 --- a/nix/kitchenWasm/default.nix +++ b/nix/kitchenWasm/default.nix @@ -26,7 +26,7 @@ stdenv.mkDerivation { mkdir -p $out cd web cp -r static $out - wasm-pack build --target web --out-dir $out; + wasm-pack build --release --target web --out-dir $out; cp -r index.html $out ''; } \ No newline at end of file