Stopping TypeScript Compile to accelerate debugging

    Due to our project architecture that consists of much of typescript file. Every model or service or controller even a dto that there is an individual file each of them.Total files are 1000 files.
 
  There are too many files in the project so that every time compiler needs waste much time to compile typescript.Today, I count the time is about 30 seconds.

  Basically, It will output js file when press saves button but when you execute compiled it will output again and along with all typescript.I don't want to compile all of the typescripts at this situation.Therefore, I found a way to disabled typescript compiled


Workaround

According to before top mention which just adds a setting to the project file "TypeScriptCompileBlocked" so that I can be disabled it.

<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>

In practice, we cannot always without complied typescripts so that I add a condition in the project file.While I need it I will switch the "Dev" mode to compile it.

1.Adding project configuration

2.ProjectGroup add a condition

  <PropertyGroup Condition="'$(Configuration)' == 'Dev'">
      <TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
  </PropertyGroup>

Testing
  • Before 38 sec
  • After: 11 sec
Reference

Popular posts from this blog

VS2017-Build fail-FindDependenciesOfExternallyResolvedReferences

IIS Block IP Setting

VS2017.15.8.4 Error fixed