plugin-typescript currently issues a warning, and rightly, when targeting module formats other than system, and es2015. In the latter case, imports are retained for further processing by Babel or via the SystemJS Builder.
TypeScript 2.4.0 added support for the proposed Dynamic Import feature.
plugin-typescript users are already able to take advantage of this feature when using "module": "system" but TypeScript does not allow the syntax to be used with "module": "es2015", as this is not a feature of the correspondingly named ECMAScript edition, and instead introduces "module": "esnext" for those who wish to forward the module syntax to another tool as mentioned.
This option actually works just fine with plugin-typescript right now, but it results in warnings as the enum value is not recognized.
It would be great if plugin-typescript extended its list of supported formats to include "module": "esnext". This option has the same behavior as "module": "es2015", except that it recognizes and retains dynamic import expressions, enabling the use cases mentioned above. I would be happy to submit a PR for this.
plugin-typescript currently issues a warning, and rightly, when targeting module formats other than
system
, andes2015
. In the latter case, imports are retained for further processing by Babel or via the SystemJS Builder.TypeScript 2.4.0 added support for the proposed Dynamic Import feature.
plugin-typescript users are already able to take advantage of this feature when using
"module": "system"
but TypeScript does not allow the syntax to be used with"module": "es2015"
, as this is not a feature of the correspondingly named ECMAScript edition, and instead introduces"module": "esnext"
for those who wish to forward the module syntax to another tool as mentioned.This option actually works just fine with plugin-typescript right now, but it results in warnings as the
enum
value is not recognized.It would be great if plugin-typescript extended its list of supported formats to include
"module": "esnext"
. This option has the same behavior as"module": "es2015"
, except that it recognizes and retains dynamic import expressions, enabling the use cases mentioned above. I would be happy to submit a PR for this.