Skip to content

MSBuild - Don't run VsTsc/recompile all files if no TypeScript files have been changed #23367

@chrisdieckhaus

Description

@chrisdieckhaus

We have a .NET MVC project with a TypeScript front-end, using tsc to compile files during build. After investigation, it appears that nearly half of our build time is occuring due to the CompileTypeScriptWithTSConfig target, task VsTsc.

Expected behavior:
If no typescript files have been updated, VsTsc should not be run, since there is no need to recompile all the changed files.

Stretch expected behavior:
If I update a TypeScript file and build, only that file should be recompiled, since no other files have changed (similar to the behavior of tsc --watch. After doing some searching, I think this might not be possible, but it's worth a shot.

Actual behavior:
On build, VsTsc is always called and all TypeScript files are recompiled, regardless of whether or not any of them have changed since last build.

Search Terms:
msbuild, vstsc, incremental build, incremental compile, compile on build, visual studio

Metadata

Metadata

Assignees

No one assigned

    Labels

    FixedA PR has been merged for this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions