surreal
surreal copied to clipboard
support scripts using module
from mdn docs:
https://developer.mozilla.org/en-US/docs/Web/API/Document/currentScript
The Document.currentScript property returns the element whose script is currently being processed and isn't a JavaScript module. (For modules use import.meta instead.)
i'm basically doing:
<script type="module">
import { thing } from './thing.js';
thing(me());
</script>
Ok, import.meta isn't helpful here. It looks like there is an open issue on the spec for this:
https://github.com/whatwg/html/issues/1013
Thanks for looking into this. Would love to make it happen once it's in available.