Skip to content

Commit

Permalink
Trying to do a wasm-bindgen build
Browse files Browse the repository at this point in the history
  • Loading branch information
surma committed Aug 7, 2024
1 parent 13cbf8d commit 9bbfac6
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
22 changes: 18 additions & 4 deletions codecs/resize/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,26 @@
{
packages = rec {
default = resize-squoosh;
resize-squoosh = naersk'.buildPackage {
resize-squoosh = stdenv.mkDerivation {
name = "squoosh-resize";
src = ./.;
release = true;
copyLibs = true;
CARGO_BUILD_TARGET = target;
nativeBuildInputs = [
#naersk'
toolchain
# wasm-pack
wasm-bindgen-cli
];
dontConfigure = true;
buildPhase = ''
export CARGO_HOME=$TMPDIR/.cargo
cargo build --target wasm32-unknown-unknown -r
wasm-bindgen --target web --out-dir $out ./target/wasm32-unknown-unknown/release/*.wasm
'';
dontInstall = true;
# installPhase = ''
# mkdir -p $out
# cp -r pkg/* $out
# '';
};

installScript = writeShellScriptBin "install.sh" ''
Expand Down
4 changes: 0 additions & 4 deletions codecs/resize/package-lock.json

This file was deleted.

6 changes: 0 additions & 6 deletions codecs/resize/package.json

This file was deleted.

0 comments on commit 9bbfac6

Please sign in to comment.