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
Import map is an option to rewrite the module path to another.
For instance, By "npm:" : "https://esm.sh/", the runtime changes the path "npm:diff" to "https://esm.sh".
According to the specification, "Only one import map is processed per Document.".
The parent module shares the document context with the child one.
Thus, the parent module should share the import-maps with the child one too.
Reproducible steps
{
"imports": {
"npm:": "https://esm.sh/"
}
}
awaitimport(newURL('child.ts',import.meta.url))
import*asdifffrom"npm:diff"diff;
Significance of this issue
#15826 , the developers have no plan to support "npm:" modules in the dynamic import.
However, we sometime need to dynamically import the third-party module depending the "npm:" module.
Further, we have no way to know which module has no dependency to "npm:" module in advance.
Therefore, to avoid "npm:" module temporally, we need to define such a rule.
Related issues
Import map not working with Worker #6675 , the parent module does not shares the document context with the worker. Thus, that issue should be discussed separately with this issue.
Import map is an option to rewrite the module path to another.
For instance, By
"npm:" : "https://esm.sh/"
, the runtime changes the path "npm:diff" to "https://esm.sh".I noticed that the import-map is unavailable in the following situation.
Expected behavior
According to the specification, "Only one import map is processed per Document.".
The parent module shares the document context with the child one.
Thus, the parent module should share the import-maps with the child one too.
Reproducible steps
Significance of this issue
#15826 , the developers have no plan to support "npm:" modules in the dynamic import.
However, we sometime need to dynamically import the third-party module depending the "npm:" module.
Further, we have no way to know which module has no dependency to "npm:" module in advance.
Therefore, to avoid "npm:" module temporally, we need to define such a rule.
Related issues
The text was updated successfully, but these errors were encountered: