如何在 Visual Studio 2015 RTM 中设置 TypeScriptTarget [英] How to set TypeScriptTarget in Visual Studio 2015 RTM

查看:42
本文介绍了如何在 Visual Studio 2015 RTM 中设置 TypeScriptTarget的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试构建项目 https://github.com/Justin-Credible/Ionic-TypeScript-MDHA-Starter 但得到很多错误:<代码>错误 TS1056:构建:访问器仅在面向 ECMAScript 5 及更高版本时可用.

I try to build the project https://github.com/Justin-Credible/Ionic-TypeScript-MDHA-Starter but get lots of error: error TS1056: Build: Accessors are only available when targeting ECMAScript 5 and higher.

我编辑了项目文件 JustinCredible.SampleApp.jsproj,将 TypeScriptTarget 添加为:<代码><属性组><TypeScriptToolsVersion>1.5</TypeScriptToolsVersion><TypeScriptTarget>ES5</TypeScriptTarget><DefaultReferenceGroup>隐式 (Apache Cordova)</DefaultReferenceGroup></PropertyGroup>但错误仍然存​​在.

I editted the project file JustinCredible.SampleApp.jsproj by adding TypeScriptTarget as: <PropertyGroup> <TypeScriptToolsVersion>1.5</TypeScriptToolsVersion> <TypeScriptTarget>ES5</TypeScriptTarget> <DefaultReferenceGroup>Implicit (Apache Cordova)</DefaultReferenceGroup> </PropertyGroup> but the error was still there.

我错过了什么吗?

推荐答案

您需要在 Sample-App\scripts 文件夹中添加一个 tsconfig.json 文件,其中包含以下内容:

You need to add a tsconfig.json file in the Sample-App\scripts folder with the following content:

{
"compilerOptions": {
    "target": "es5",
    "out": "www/scripts/appBundle.js",
    "sourceMap": true,
    "removeComments": true,
    "sourceRoot": "/"
    }
}

这篇关于如何在 Visual Studio 2015 RTM 中设置 TypeScriptTarget的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆