Since Typescript 2.0 you could also use the --lib
compiler flag or a "lib": []
section in your tsconfig.js
file to include ES6
features, while still targeting ES5
. See https://github.com/Microsoft/TypeScript/issues/6974
In this case just include the following configuration options in your tsconfig.js
:
...
"lib": [ "es6" ],
"target": "es5"
...