According to the docs, libheif hast to be imported like this:
https://github.com/catdad-experiments/libheif-js?tab=readme-ov-file#usage
<script type="module">
import libheif from 'https://cdn.jsdelivr.net/npm/libheif-js@1.19.8/libheif-wasm/libheif-bundle.mjs';
</script>
But this does not work (in the browser console, libheif is a function).
It only works if I add window.libheif = libheif(); to the statement, why is that?
<script type="module">
import libheif from 'https://cdn.jsdelivr.net/npm/libheif-js@1.19.8/libheif-wasm/libheif-bundle.mjs';
window.libheif = libheif();
</script>
According to the docs, libheif hast to be imported like this:
https://github.com/catdad-experiments/libheif-js?tab=readme-ov-file#usage
But this does not work (in the browser console,
libheifis a function).It only works if I add
window.libheif = libheif();to the statement, why is that?