ESModules without dynamic import is incomplete.
We cannot do this:
if( whenWeNeed() )
import 'some_thing';
nor this:
const need= whatWeNeed();
import need;
Only dynamic import can make ESM as strong as CommonJS or AMD.
Maybe there are some security reasons. But local dynamic import should be retain.
Dynamic import is indeed not yet supported. I was surprised to see that we don't have an issue for this yet. Thanks for creating this - it's on my roadmap.
Oh thanks @hayd. Somehow that didn't come up when I was searching.
Closing. Duplicate of #1789.
Oh thanks @hayd. Somehow that didn't come up when I was searching.
Closing. Duplicate of #1789.
so did I
Most helpful comment
Dynamic import is indeed not yet supported. I was surprised to see that we don't have an issue for this yet. Thanks for creating this - it's on my roadmap.