Using tsconfig.json with Visual Studio 2013? (web project)

I use Angular 2 in my web project, and therefore I need TypeScript to support experimental decorators like @View. This can be done in tsconfig.json with "experimentalDecorators": true , but I do not see such an option in the settings of the Visual Studio project. (I created a TypeScript project.) So I need Visual Studio to discover and use my tsconfig.json file.

I read in various places online that Visual Studio should pick up and use tsconfig.json if it is present in the root directory of the project. However, this does not happen. I am using Visual Studio 2013 Update 4 - and upgrade to update 5 when I write this.

Does anyone know how to get Visual Studio 2013 (NOT Visual Studio Code and NOT Visual Studio 2015) to use the tsconfig.json file? Maybe it should be at the root of the solution instead of the root of the project?

Otherwise, I can try to add a pre-build event to directly call tsc ... but that seems messy.

+5
source share
2 answers

I was looking for this too. Visual Studio 2013-2015 doesn't seem to support tsconfig.json yet. Currently, you need to edit the project file.

Edit: With Typescript 1.8, release the seams of Visual Studio 2015 for full support for .tsconfig. See http://www.typescriptlang.org/docs/release-notes/typescript-1.8.html

+2
source

Next question: What are the configuration options for the TypeScript project assembly? points to a .targets file where TypeScript configuration parameters are defined.

You can manually modify this .targets file to add support for experimental decorators, although this does not scale because you will need to do this on every developer's computer.

0
source

Source: https://habr.com/ru/post/1234057/


All Articles