11

I need to know how to disable compile on save for typescript files?

  • 1
    to disable it just upgrade to RTM because they broke it :-/ https://connect.microsoft.com/VisualStudio/feedback/details/1581065/typescript-compile-output-into-single-file-not-working-on-save ;-) – Simon_Weaver Aug 01 '15 at 18:04

2 Answers2

22

Typescript compilation is enabled by default. You can do next to disable it:

  1. Select and click 'Unload Project' menu item.
  2. Select unloaded project and click 'Edit .kproj'.
  3. Add new 'PropertyGroup' node to projects root node:
<?xml version="1.0" encoding="utf-8"?>
<Project ...>
...
<PropertyGroup>
<TypeScriptCompileOnSaveEnabled>False</TypeScriptCompileOnSaveEnabled>
</PropertyGroup>
</Project>
  • Is their a way to compile the script on save but not save the .js file ? – RPDeshaies Apr 10 '15 at 23:33
  • 1
    In 3rd point should be "add new 'PropertyGroup'" not "ProjectGroup". I wanted to edit it, but StackOverflow doesn't allow to make such small changes – Piotrek Aug 16 '16 at 08:52
6

For loose files (outside of a project)

Tools -> Options

  • Text Editor
    • TypeScript
      • Project

[ ] Automatically compile TypeScript files which are not part of a project

For projects

Right-click the project -> Properties

Select the "TypeScript Build" tab (on the left)

Uncheck "Compile on save" under the "General" heading

Ryan Cavanaugh
  • 209,514
  • 56
  • 272
  • 235
  • 4
    To be clear there is no Typescript Build tab for Asp.net 5 projects. – Elizabeth Schneider Feb 24 '15 at 21:01
  • 2
    For the new VS2015 when using ASP.Net 5 projects, this setting can be found on the `Build` tab as `Compile TypeScript on build`. – Matt DeKrey Aug 31 '15 at 13:07
  • Compile typescript on build doesn not prevent js fiels to be created on save. It seems that TypeScriptCompileOnSaveEnabled still doens't work on ASP.NET 5 projects – nemenos Sep 03 '15 at 09:43
  • More details about "Compile on save" in ASP.NET 5 projects can be found in this article: https://github.com/Microsoft/TypeScript/wiki/Using-TypeScript-With-ASP.NET-5#user-content-compile-on-save – marianc Dec 14 '15 at 16:32