Use wasm dev builds for deploy previews
MODIFY
netlify.toml
netlify.toml
[build]
base = "website/"
publish = "build/"
+
+[context.production]
command = "./build-netlify.sh"
+
+[context.deploy-preview]
+command = "./build-netlify.sh preview"

MODIFY
website/build-netlify.sh
website/build-netlify.sh
#!/bin/sh
+if ! command -v wasm-pack &> /dev/null; then
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
+fi
+
+if [ "$1" == "preview" ]; then
+ pnpm build:wasm-dev
+else
pnpm build:wasm
+fi
+
+# Run pnpm install again to ensure wasm gets linked
pnpm install
+
+# Finally build website
pnpm build:js

Use wasm dev builds for deploy previews