the RustModule for the wasm target now builds the npm Package with wasm-pack

This commit is contained in:
Sebastian Moser
2024-10-20 12:37:04 +02:00
parent 601362a109
commit 2c822641b2
2 changed files with 31 additions and 14 deletions

View File

@@ -133,16 +133,18 @@ in {
# i can't use CARGO_BUILD_TARGET to set the target
# because then the cargo install run by wasm-pack tries to build the wasm-bindgen-cli for a wasm target...
cargoExtraArgs = "--target wasm32-unknown-unknown --features wasm-target";
src = self;
cargoArtifacts = wasmArtifacts;
doCheck = false;
buildPhaseCargoCommand = ''
mkdir -p $out/pkg
echo build hiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
mkdir -p $out/pkg
HOME=$(mktemp -d fake-homeXXXX) wasm-pack build --out-dir $out/pkg --scope=c2vi -- --features wasm-target
HOME=$(mktemp -d fake-homeXXXX) wasm-pack build --out-dir $out/pkg --scope=c2vi -- --no-default-features --features wasm-target
'';
buildInputs = with pkgs; [ wasm-bindgen-cli binaryen wasm-pack wasmToolchain ];