Skip to content

Commit

Permalink
fix: publish fixed wasm runtime (#305)
Browse files Browse the repository at this point in the history
  • Loading branch information
lsndr authored Oct 3, 2024
1 parent 21ecd6c commit 999934b
Show file tree
Hide file tree
Showing 4 changed files with 11,567 additions and 3 deletions.
13 changes: 11 additions & 2 deletions browser.replacer.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
module.exports.default = ({ orig, file }) => {
if (!file.includes('dist/browser') || orig !== "from '@lib'") {
if (!file.includes('dist/browser')) {
return orig;
}

return "from '@rrule-rust/lib-wasm32-wasi'";
switch (orig) {
case "from '@lib'":
return "from '@rrule-rust/lib-wasm32-wasi'";
case "require('@napi-rs/wasm-runtime')":
return "frequire('./runtime.js')";
case "from '@napi-rs/wasm-runtime'":
return "from './runtime.js'";
default:
return orig;
}
};
1 change: 1 addition & 0 deletions npm/wasm32-wasi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"rrule-rust.wasi.cjs",
"rrule-rust.wasi-browser.js",
"wasi-worker.mjs",
"runtime.js",
"wasi-worker-browser.mjs",
"patches/**/*"
],
Expand Down
Loading

0 comments on commit 999934b

Please sign in to comment.