Deno: Dynamic import require

Created on 5 Apr 2019  路  4Comments  路  Source: denoland/deno

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.

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.

All 4 comments

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.

1789 is related (also on ry's 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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ry picture ry  路  3Comments

sh7dm picture sh7dm  路  3Comments

ry picture ry  路  3Comments

JosephAkayesi picture JosephAkayesi  路  3Comments

justjavac picture justjavac  路  3Comments