2024-09-03 17:51:07 +08:00
|
|
|
diff --git a/pkg/standalone.js b/pkg/standalone.js
|
2024-02-01 20:00:32 +08:00
|
|
|
index 7be08fc..35777bf 100644
|
2024-09-03 17:51:07 +08:00
|
|
|
--- a/pkg/standalone.js
|
|
|
|
+++ b/pkg/standalone.js
|
2024-02-01 20:00:32 +08:00
|
|
|
@@ -1,7 +1,8 @@
|
2023-12-14 19:00:36 +08:00
|
|
|
-import init from "./standalone/content_tag.js";
|
|
|
|
+import { initSync } from "./standalone/content_tag.js";
|
|
|
|
+import module from "./standalone/content_tag_bg.wasm";
|
2024-02-01 20:00:32 +08:00
|
|
|
import { Preprocessor as WasmPreprocessor } from "./standalone/content_tag.js";
|
2023-12-14 19:00:36 +08:00
|
|
|
|
|
|
|
-await init();
|
|
|
|
+initSync(module);
|
|
|
|
|
2024-02-01 20:00:32 +08:00
|
|
|
const defaultOptions = {
|
|
|
|
inline_source_map: false,
|
2024-09-03 17:51:07 +08:00
|
|
|
diff --git a/pkg/standalone/content_tag.js b/pkg/standalone/content_tag.js
|
2024-02-02 20:33:29 +08:00
|
|
|
index aaefe00..bb20026 100644
|
2024-09-03 17:51:07 +08:00
|
|
|
--- a/pkg/standalone/content_tag.js
|
|
|
|
+++ b/pkg/standalone/content_tag.js
|
2023-12-14 19:00:36 +08:00
|
|
|
@@ -20,6 +20,7 @@ function takeObject(idx) {
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
+const { TextDecoder, TextEncoder } = require('util');
|
|
|
|
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
|
|
|
|
|
|
|
|
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
|