How to install TypeScriptTarget in Visual Studio 2015 RTM

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

I edited the project file JustinCredible.SampleApp.jsproj

adding TypeScriptTarget

like:    <PropertyGroup> <TypeScriptToolsVersion>1.5</TypeScriptToolsVersion> <TypeScriptTarget>ES5</TypeScriptTarget> <DefaultReferenceGroup>Implicit (Apache Cordova)</DefaultReferenceGroup> </PropertyGroup>

but the error was still there.

Did I miss something?

+3


source to share


2 answers


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



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

      

+3


source


Apparently, these property groups are read and applied consistently. If you move the property group further into the project file, this also fixes the problem.



0


source







All Articles