We have an MSBuild script which we use to compile all our .ts files in our project. First we create a propery group containing all the .ts files;
<ItemGroup>
<AllTypeScriptFiles Include="XXXXX\Scripts\**\*.ts;" Exclude="XXXX\Scripts\**\*.d.ts;" />
</ItemGroup>
Then we dump this file list to an input file and run tsc.exe;
<WriteLinesToFile
File="typescriptcompiler.input"
Lines="@(AllTypeScriptFiles)"
Overwrite="true"
Encoding="Unicode"/>
<Exec Command=""$(MSBuildProgramFiles32)\Microsoft SDKs\TypeScript\$(TypeScriptVersion)\tsc" --target ES5 @typescriptcompiler.input"
CustomErrorRegularExpression="\.ts\([0-9]+,[0-9]+\):(.*)"
IgnoreExitCode="true" >
</Exec>
Now, the output states that some files can not be found;
Error reading file "XXXXX.ts": File not found
This happens to some files, but if I run tsc.exe giving the exact same path as the error message I get no errors and the file is compiled.
If I rather compile each file in sequence instead:
<Exec Command=""$(MSBuildProgramFiles32)\Microsoft SDKs\TypeScript\$(TypeScriptVersion)\tsc" --target ES5 "%(AllTypeScriptFiles.Identity)""
CustomErrorRegularExpression="\.ts\([0-9]+,[0-9]+\):(.*)"
IgnoreExitCode="true" >
</Exec>
All files are compiled without problems, except it takes 5 minutes instead of 10 seconds...