mirror of
https://github.com/loro-dev/loro.git
synced 2024-11-24 12:20:06 +00:00
chore: fix base64 build in cloudflare worker
This commit is contained in:
parent
c4a9729c9c
commit
3f34a9eb71
3 changed files with 16 additions and 5 deletions
|
@ -1,5 +1,11 @@
|
|||
# Changelog
|
||||
|
||||
## 1.1.3-alpha.0
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Chore fix base64 built target in cloudflare worker
|
||||
|
||||
## 1.1.2
|
||||
|
||||
### Patch Changes
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "loro-crdt",
|
||||
"version": "1.1.2",
|
||||
"version": "1.1.3-alpha.0",
|
||||
"description": "Loro CRDTs is a high-performance CRDT framework that makes your app state synchronized, collaborative and maintainable effortlessly.",
|
||||
"keywords": [
|
||||
"crdt",
|
||||
|
|
|
@ -75,10 +75,15 @@ async function rollupBase64() {
|
|||
/\{\s*const wkmod = await import\('\.\/loro_wasm_bg-([^']+)\.js'\);\s*const instance = new WebAssembly\.Instance\(wkmod\.default, \{\s*"\.\/loro_wasm_bg\.js": imports,\s*\}\);\s*__wbg_set_wasm\(instance\.exports\);\s*\}/;
|
||||
const toReplaceTarget = `
|
||||
import loro_wasm_bg_js from './loro_wasm_bg-$1.js';
|
||||
const instance = new WebAssembly.Instance(loro_wasm_bg_js(), {
|
||||
"./loro_wasm_bg.js": imports,
|
||||
});
|
||||
__wbg_set_wasm(instance.exports);
|
||||
if (wasm.__wbindgen_start) {
|
||||
imports.__wbg_set_wasm(loro_wasm_bg_js());
|
||||
wasm.__wbindgen_start();
|
||||
} else {
|
||||
const instance = new WebAssembly.Instance(loro_wasm_bg_js(), {
|
||||
"./loro_wasm_bg.js": imports,
|
||||
});
|
||||
__wbg_set_wasm(instance.exports);
|
||||
}
|
||||
`;
|
||||
const base64IndexPath = "./base64/index.js";
|
||||
const content = await Deno.readTextFile(base64IndexPath);
|
||||
|
|
Loading…
Reference in a new issue