[Proposal] Hash (local) script imports

Currently to import a script you need it to have a URL, such as an HTTP url, data or blob. But there is no way to import modules that are local to the document inside a script tag. what if you could use a hash URI to import those? Like this:

<script type="module" id="someLocalScript">
export function fun() { return "Hello" }

<script type="module">
   import {fun} from "#someLocalScript"

I’ve encountered this trying to build some browser-based dev-tools, and had to resort to using blobs and eval to achieve something similar.