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
When a module containing a relative dynamic import is included in a bundle, currently we don't make any modifications to the specifier. The exact resolution should be preserved by hardcoding the original referrer.
// In a module https://example.com/foo.ts:awaitimport(specifier);// when bundled should first and foremost be transformed to:awaitimport(newURL(specifier,import.meta.url));// which should then go through our existing `import.meta` hardcoding, making it:constimportMeta={url: "https://example.com/foo.ts",main: false,};awaitimport(newURL("./foo.ts",importMeta.url).href);
However, trying to use the URL global here is vulnerable and doesn't provide import map resolution.
We should wait for something like import.meta.resolve() before fixing this. Any complications are deferred naturally to our handling of that.
// In a module https://example.com/foo.ts:awaitimport(specifier);// when bundled should first and foremost be transformed to:awaitimport(import.meta.resolve(specifier));// which should then go through our existing `import.meta` hardcoding, making it:constimportMeta={url: "https://example.com/foo.ts",main: false,resolve(specifier){// Inlined generic resolution, relative to `importMeta.url`, containing a hardcoded import map.}};awaitimport(importMeta.resolve(specifier));
When a module containing a relative dynamic import is included in a bundle, currently we don't make any modifications to the specifier. The exact resolution should be preserved by hardcoding the original referrer.
However, trying to use the
URL
global here is vulnerable and doesn't provide import map resolution.We should wait for something like
import.meta.resolve()
before fixing this. Any complications are deferred naturally to our handling of that.Ref #7296, whatwg/html#5572.
cc @guybedford
The text was updated successfully, but these errors were encountered: