Targeting ES5 with TypeScript in Visual Studio

后端 未结 5 960
名媛妹妹
名媛妹妹 2020-12-06 04:31

I would like to use get/set syntax in TypeScript within Visual Studio Express for Web. How do I enable this. I currently get this error when compiling;

5条回答
  •  醉酒成梦
    2020-12-06 04:57

    You need to pass the -target ES5 to the compiler. The compilation is triggered using an msbuild task in your project file. Your project file probably has a "TypeScriptCompile" target like the onr bellow, just make sure to the target argument is passed. Here is an example:

    
       
       
    
    

提交回复
热议问题