Closed
Description
openedon Dec 15, 2016
The proposal for function-like import() is currently in stage-3, and I think it'd be nice if Typescript will support it in future versions.
For example, one such project that already supports it is webpack which checks for import() as a code-splitting construct (deprecating System.import in v2 and replacing it altogether in v3).
TypeScript Version: 2.0.10
Code
// A *self-contained* demonstration of the problem follows...
import('page/profile').then(() => /* load route */ );
Expected behavior:
The compiler allows the dynamic import syntax as above.
Actual behavior:
-> error TS1128: Declaration or statement expected.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment