mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-18 17:14:20 +01:00
hack imports of wasm due to the issues in Vite and Next.js build systems
This commit is contained in:
9
bindings/javascript/packages/browser/wasm-inline.ts
Normal file
9
bindings/javascript/packages/browser/wasm-inline.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
const tursoWasmBase64 = '__PLACEHOLDER__';
|
||||
async function convertBase64ToBinary(base64Url: string): Promise<ArrayBuffer> {
|
||||
const blob = await fetch(base64Url).then(res => res.blob());
|
||||
return await blob.arrayBuffer();
|
||||
}
|
||||
|
||||
export async function tursoWasm(): Promise<ArrayBuffer> {
|
||||
return await convertBase64ToBinary(tursoWasmBase64);
|
||||
}
|
||||
Reference in New Issue
Block a user