Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
861 views
in Technique[技术] by (71.8m points)

typescript - What is target in tsconfig.json for?

What does target in tsconfig.json signify?

{
  "compilerOptions": 
  {
    "sourceMap": true,
    "target": "es5",
    "module": "commonjs",
    "jsx": "react",
    "moduleResolution": "classic",
    "lib": [ "es2015", "dom",  "es2017" ]
  }
}
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I am quite new to Typescript. What does Target in tsconfig.json signify?

target signifies which target of JavaScript should be emitted from the given TypeScript. Examples:

target:es5

()=>null will become function(){return null} as ES5 doesn't have arrow functions.

target:es6

()=>null will become ()=>null as ES6 has arrow functions.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...