Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does compilerOptions.target specify in tsconfig.json?

So as of mid-2016 just about all the Angular2 TypeScript tutorials and examples use "target": "es5" in the compilerOptions section of the tsconfig.json file.

I also see people saying that setting "target": "es6" makes a lot of their errors/problems go away.

{
  "compilerOptions": {
    "target": "es6",
    ...
  }
}

But what exactly is this specifying? Is this telling the TypeScript compiler what version of ECMAScript to generate?

like image 590
Rafe Avatar asked Jul 27 '16 22:07

Rafe


1 Answers

Yes, it sets the target version to ES6. Check the following out:

https://www.typescriptlang.org/docs/handbook/tsconfig-json.html https://www.typescriptlang.org/docs/handbook/compiler-options.html

like image 159
Hans Strausl Avatar answered Oct 07 '22 22:10

Hans Strausl