Skip to content

Commit ab9ca86

Browse files
authored
fix prettier vscode plugin does not work (#20)
1 parent 4b7d04d commit ab9ca86

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/replace.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ const prefix = "/*" + magic;
33
const postfix = magic + "*/";
44

55
export async function preProcess(code) {
6+
globalThis.WebAssembly.instantiateStreaming =
7+
globalThis.WebAssembly.instantiateStreaming ??
8+
(async (source, importObject) => {
9+
const response = await Promise.resolve(source);
10+
const buffer = await response.arrayBuffer();
11+
return WebAssembly.instantiate(buffer, importObject);
12+
});
613
const assemblyscript = await import("assemblyscript");
714
const NodeKind = assemblyscript.NodeKind;
815
const visitDecorators = (node) => {

0 commit comments

Comments
 (0)