TypeScript Version: 2.4.1 / nightly (2.5.0-dev.20170629)
Code
Expected behavior:
Output of:
Actual behavior:
Output of:
(import)("./" + "module");
Using "target": "es5" and "module": "esnext", TypeScript outputs invalid syntax for the dynamic import expression, wrapping it in parentheses.
Using a target of es2015 or higher, TypeScript outputs valid syntax with no parentheses.
This is only happens if import is given a template string.
TypeScript Version: 2.4.1 / nightly (2.5.0-dev.20170629)
Code
Expected behavior:
Output of:
Actual behavior:
Output of:
Using
"target": "es5"and"module": "esnext", TypeScript outputs invalid syntax for the dynamic import expression, wrapping it in parentheses.Using a target of
es2015or higher, TypeScript outputs valid syntax with no parentheses.This is only happens if
importis given a template string.