Skip to content

Commit

Permalink
Add option to use location.pathname instead of URL
Browse files Browse the repository at this point in the history
  • Loading branch information
pol-rivero committed Feb 2, 2023
1 parent 9f28494 commit 2fa5fa1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion protochess-engine-wasm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ pkg-parallel: src/*
RUSTC_BOOTSTRAP=1 RUSTFLAGS="-C target-feature=+atomics,+bulk-memory,+mutable-globals" \
wasm-pack build --target web --release --out-dir pkg-parallel \
-- . --features parallel -Z build-std=panic_abort,std


# This is a hack to make wasm-bindgen-rayon work with Vite
# Replace the string "new URL('./workerHelpers.js', import.meta.url)" with "location.pathname" in all files under pkg-parallel/snippets
use-pathname:
find pkg-parallel/snippets -type f -exec sed -i 's/new URL(.*workerHelpers.js.*import.meta.url.*),/location.pathname,/g' {} +

clean:
rm -rf pkg pkg-parallel
cargo clean

0 comments on commit 2fa5fa1

Please sign in to comment.