In my visual studio 2015 project I created a typescript file file1.ts
. I have also a tsconfig.json file in my project root folder. I installed tsc globally via npm. I also installed typescript for visual studio from here: https://www.microsoft.com/en-us/download/details.aspx?id=48593
But when I'm compiling my project, I don't get any .js file from my .ts file. But I got a Typescript Virtual Project. After reading a lot of posts here in stackoverflow, I tried a lot to find the problem. Some people posted screenshots where you can see, that they have "Typescript Options" in Project Properties window like here:
The typescript virtual project looks like:
In the .ts file I use some example code:
class Startup {
public static main(): number {
console.log('Hello World');
return 0;
}
}
And the tsconfig.json code is:
{
"compilerOptions": {
"module": "commonjs",
"noImplicitAny": true,
"removeComments": true,
"preserveConstEnums": true,
"sourceMap": true
}
}
What do I have to do to let the compiler create .js files from my .ts files of my project?
EDIT:
I know in Visual Studio 2015 it is working out of the box if you use asp.net 5 project templates. But I have an existing project and it isn't working there. So there must be an option to get this functionality for existing projects!?
You don't need any of that IF you are using Visual Studio 2015 its out of the box as long as you are using at least RTM version of VS 2015. I'll assume you are since that was the extension page you posted :)
For example - just create a new ASP.NET 5 project, drop in a .ts file, add some code. Notice my typescript file here shows the .ts and its processed .js file underneath it. The npm, add-in install, etc are all unncessary if using 2015, it is handled out of the box.
Note that for MVC 5 projects, it doesn't show up quite as nice. Click the "Show all files" icon which is the third from the right icon below and then you'll see your .js file after you've added a .ts file. Mine appeared as soon as I refreshed the project view (ensure you are clicking on your project and then you'll see the refresh icon show up in solution explorer)