ts-browser
ts-browser copied to clipboard
Supporting importmaps
Hi
First, thanks for making this cool script to have typescript in the browser!
Without Typescript, the browsers support "importmap"s to easily load external resources:
<html>
<head>
<script type="importmap">
{
"imports": {
"random": "https://cdn.jsdelivr.net/npm/[email protected]/+esm",
}
}
</script>
<script type="module">
import random from 'random'
...
</script>
Is there a chance we could support this here, too?
Also when I try to import the full url it doesn't work: import random from 'https://cdn.jsdelivr.net/npm/[email protected]/+esm'
will attach a ".ts" ending and then can't find the url.
Hm, I wonder how widely used this importmap thing is used. I doubt I'll have the resources to work on this thing anytime soon. PRs welcome I guess.