Skip to content

Commit

Permalink
examples: trunk-workspace: update for future compat
Browse files Browse the repository at this point in the history
Looks like newer versions of trunk expect the current directory to be
the crate to compile, so adjust the example to take that into account
  • Loading branch information
ipetkov committed Nov 18, 2024
1 parent 182bbb4 commit 9132c6d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion examples/trunk-workspace/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,15 @@
myClient = craneLib.buildTrunkPackage (wasmArgs // {
pname = "trunk-workspace-client";
cargoArtifacts = cargoArtifactsWasm;
trunkIndexPath = "client/index.html";
# Trunk expects the current directory to be the crate to compile
preBuild = ''
cd ./client
'';
# After building, move the `dist` artifacts and restore the working directory
postBuild = ''
mv ./dist ..
cd ..
'';
# The version of wasm-bindgen-cli here must match the one from Cargo.lock.
wasm-bindgen-cli = pkgs.wasm-bindgen-cli.override {
version = "0.2.93";
Expand Down

0 comments on commit 9132c6d

Please sign in to comment.