Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to stop VS2015 Typescript compilation on build?

Tags:

asp.net-core

I'm running a Asp.Net Core RC2, project.json project and have setup gulp to watch and compile my typescript to a different location. But Visual Studio 2015 is also compiling the typescript each time I compile, giving me duplicates of each js file. How do I stop VS from compiling my typescript files.

I have disabled compile on save in my tsconfig.json, but there seams to be no options for disabled it on build.

{ "compileOnSave": false }

like image 401
Christian Avatar asked Jun 03 '16 08:06

Christian


People also ask

How do I disable TypeScript in a project?

Currently, there are a few ways to "disable TypeScript" in VS. You could go to Tools > Options > Text Editor > JavaScript/TypeScript > Project and uncheck the Project Analysis options. Or you could change your TS files to be JS files, as the language service only runs on TS files.

How do I compile a whole TypeScript project?

TypeScript supports compiling a whole project at once by including the tsconfig. json file in the root directory. The tsconfig. json file is a simple file in JSON format where we can specify various options to tell the compiler how to compile the current project.

What is TypeScript compilation?

The TypeScript compiler compiles these files and outputs the JavaScript with . js extension by keeping the same file name as the individual input file. The TypeScript compiler also preserves the original file path, hence the . js output file will be generated where the input file was in the directory structure.


2 Answers

In RC2, you can disable it by adding TypeScriptCompileBlocked to the .xproj file.

<PropertyGroup>
  <TypeScriptCompileBlocked>True</TypeScriptCompileBlocked>
</PropertyGroup>
like image 155
fszlin Avatar answered Oct 21 '22 14:10

fszlin


This worked for me, add this to you .xproj file

<PropertyGroup>
   <TypeScriptCompileOnSaveEnabled>False</TypeScriptCompileOnSaveEnabled>
</PropertyGroup>
like image 41
mlapaglia Avatar answered Oct 21 '22 14:10

mlapaglia