Is it possible to use a full URL in a dynamic import()
statement in ES6/Typescript?
import('https://foo.com/mymodule.js').then(() => {
console.log('mymodule is loaded');
});
I get an error
//Cannot find module 'https://foo.com/mymodule.js'.
With Webpack and Typescript, we're already successfully using a relative path with a dynamic import
import(/* webpackChunkName: "mymodule" */ '../mymodule');
so it seems that Webpack already does module loading at runtime.
eval
. – Kutch