7f8da5e6a9
This can be used as a reference for how to build a wasm project with crate2nix. Change-Id: Ib4d0db6bf24d8f1dec4734d5f1e8de19212a54cd Reviewed-on: https://cl.tvl.fyi/c/depot/+/11859 Reviewed-by: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
15 lines
401 B
Nix
15 lines
401 B
Nix
{ pkgs, lib, ... }:
|
|
|
|
(pkgs.pkgsCross.wasm32-unknown-none.callPackage ./Cargo.nix { }).rootCrate.build.overrideAttrs (oldAttrs: {
|
|
installPhase = ''
|
|
${lib.getExe pkgs.wasm-bindgen-cli} \
|
|
--target web \
|
|
--out-dir $out \
|
|
--out-name ${oldAttrs.crateName} \
|
|
--no-typescript \
|
|
target/lib/${oldAttrs.crateName}-${oldAttrs.metadata}.wasm
|
|
|
|
mv src/*.html $out
|
|
'';
|
|
})
|
|
|