Skip to content
Prev Previous commit
Next Next commit
fix: generate wasm that won't fail
  • Loading branch information
brettkolodny committed May 31, 2025
commit e28d874b49a2fa3eaf99bab58ae030b9efe6db6f
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@
build-wasm: build/preview.wasm
mkdir -p public/build

# TODO: remove vendoring workaround
build/preview.wasm: $(GO_SRC_FILES)
GOOS=js GOARCH=wasm go build -C ./preview -o ../public/build/preview.wasm o
cd preview && go mod vendor
(find preview/vendor -name "*.go" -type f -exec sed -i 's/os\.Getwd()/"", nil/g' {} +)
GOOS=js GOARCH=wasm go build -C ./preview -o ../public/build/preview.wasm
rm -rf preview/vendor

.PHONY: gen-types
gen-types: src/gen/types.ts
Expand Down
Binary file modified public/build/preview.wasm
Binary file not shown.