@shikijs/core 1.5.0 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +8 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -4979,6 +4979,14 @@ function loadWasm(options) {
|
|
|
4979
4979
|
else if (isArrayBuffer(instance)) {
|
|
4980
4980
|
instance = await _makeArrayBufferLoader(instance)(info);
|
|
4981
4981
|
}
|
|
4982
|
+
// import("shiki/onig.wasm") returns `{ default: WebAssembly.Module }` on cloudflare workers
|
|
4983
|
+
// https://developers.cloudflare.com/workers/wrangler/bundling/
|
|
4984
|
+
else if (instance instanceof WebAssembly.Module) {
|
|
4985
|
+
instance = await _makeArrayBufferLoader(instance)(info);
|
|
4986
|
+
}
|
|
4987
|
+
else if ('default' in instance && instance.default instanceof WebAssembly.Module) {
|
|
4988
|
+
instance = await _makeArrayBufferLoader(instance.default)(info);
|
|
4989
|
+
}
|
|
4982
4990
|
}
|
|
4983
4991
|
if ('instance' in instance)
|
|
4984
4992
|
instance = instance.instance;
|