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

kitsonk picture kitsonk  路  3Comments

xueqingxiao picture xueqingxiao  路  3Comments

ry picture ry  路  3Comments

davidbarratt picture davidbarratt  路  3Comments

ry picture ry  路  3Comments