-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Proposal: script type="module" has module related properties #2235
Description
Hi. Best I can tell, a <script type="module">...</script> html element does not in any way reveal any of the content of the module inside of it. I would like to see the html element in some way declaratively identify what the module is. Totally spit-baling but perhaps a document.getElementById('mymodule').exports and document.getElementById('mymodule').default properties to expose what the script has?
I could be totally missing some way that HTMLScriptElement reveal what their content is, but I can't see right now how it is via the DOM that they reveal their contents, and I think there should be some DOM means for ES6M to explain what they have in them.
Short of having this functionality, everyone and their mother is going to have to import(scriptEl.getAttribute("src")).then(/* blah blah blah*/). And that seems ridiculous. The actual scriptEl itself ought provide a listing of what it exports & it's defaults.
Please finish this missing part of the Js/DOM relationship.