Closed bartlomieju closed 2 years ago
There's this issue about workers: https://github.com/WICG/import-maps/issues/2 if that helps.
I would expect import maps to be applied to everything, including the root script.
This is largely a decision for deno to make. Does it take as input URLs, or module specifiers? URLs (which on the web show up in places like <script src="url">
or <link rel="modulepreload" href="url">
) don't get remapped by import maps; that's why we have future proposals for import:
URLs and import.meta.resolve()
. Module specifiers do get remapped.
I can tell you that on the web, new Worker()
takes a URL, so it wouldn't get remapped.
Inside the Worker is a whole 'nother story; currently you cannot use import maps inside workers according to this spec, but that's a TODO as discussed in #2.
During implementation of import maps for Deno I believe I read that import maps shouldn't be applied to root script as well as workers root script, but now I can't find any mention about it now.
Example:
main script:
worker example:
Could you clarify that @domenic? Thanks in advance.