Hacking Together Our Own import from ‘#id’ Exports/imports between inline scripts aren’t natively supported, but it was a fun exercise to hack together an implementation for my documents. Code-golfed down to a small block, I use it like this: <script type=”module” data-info=”https://stackoverflow.com/a/43834063″>let l,e,t=”script”,p=/(from\s+|import\s+)[‘”](#[\w\-]+)[‘”]/g,x=’textContent’,d=document, s,o;for(o of d.querySelectorAll(t+'[type=inline-module]’))l=d.createElement(t),o .id?l.id=o.id:0,l.type=”module”,l[x]=o[x].replace(p,(u,a,z)=>(e=d.querySelector( t+z+'[type=module][src]’))?a+`/* ${z} */’${e.src}’`:u),l.src=URL.createObjectURL (new Blob([l[x]],{type:’application/java’+t})),o.replaceWith(l)//inline</script> <script type=”inline-module” id=”utils”> … Read more