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 }}
This repository has been archived by the owner on Nov 13, 2022. It is now read-only.
When a browser supports dynamic imports it is shimmed like this:
self[importFunctionName] = new Function('u', `return import(u)`);
This is incorrect because the URL is no longer resolved relative to importing module, but relative to the dynamic import polyfill file instead. This is a problem for example loading modules from different on a CDN.
Ideally we would have access to the importing module location, so that urls can be resolved transparently relative to the importing module with new URL(id, importer), then there is no need for setting a module directory.
Without that, I think the urls in native dynamic imports should be resolved relative to the module directory so that the behaviour is identical to the behaviour of the polyfill.
The text was updated successfully, but these errors were encountered:
LarsDenBakker
changed the title
dynamic imports urls are not resolved correctly on browsers which support dynamic imports antively
dynamic imports urls are not resolved correctly on browsers which support dynamic imports natively
Mar 16, 2020
When a browser supports dynamic imports it is shimmed like this:
self[importFunctionName] = new Function('u', `return import(u)`);
This is incorrect because the URL is no longer resolved relative to importing module, but relative to the dynamic import polyfill file instead. This is a problem for example loading modules from different on a CDN.
Ideally we would have access to the importing module location, so that urls can be resolved transparently relative to the importing module with
new URL(id, importer)
, then there is no need for setting a module directory.Without that, I think the urls in native dynamic imports should be resolved relative to the module directory so that the behaviour is identical to the behaviour of the polyfill.
The text was updated successfully, but these errors were encountered: