You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Supporting import maps in worker environments #8173
I'd like to propose we work towards a solution for providing import maps to worker environments.
Currently new Worker(..., { type: 'module' }) will run in a unique resolution environment that does not provide access to the import maps present in the parent page.
Bringing the benefits of import maps to workers would be a worthwhile effort.
I would like to propose that the API support the following capabilities:
The ability to instantiate a Worker such that it shares the import map of the parent resolution environment.
The ability to instantiate a Worker with a custom import map JSON object.
Optionally, but not necessarily, the ability to update the import map of a worker after the worker is initialized.
Extending these options not only to Worker but also to SharedWorker and Worklet initializations.
If there is rough agreement on this direction, and some of the above requirements, perhaps we can start to sketch out an API with an eye towards a PR soon? I think it would be really good to get this moving at this point in time so that users can benefit from import maps outside of the main thread.
Activity
domenic commentedon Aug 9, 2022
Let's keep this discussion in WICG/import-maps#2 since import maps is not yet part of HTML.
LeaVerou commentedon Feb 14, 2026
Now that they are and https://github.com/WICG/import-maps/ is archived, should we reopen this? (or #11002 which was about the same thing)
There is currently no open issue tracking this problem, only a (stalled) PR: #10858