Using tsc command it's as easy as running:
tsc --out all.js js/*.ts
How can I configure Visual Studio to do that when I build my project?
Just got it. Add this line:
<Exec Command="tsc --out all.js @(TypeScriptCompile ->'"%(fullpath)"', ' ')" />
to the BeforeBuild
target of your .csproj
or .vbproj
file, like this:
<Target Name="BeforeBuild">
<Message Text="Compiling TypeScript files" />
<Message Text="Executing tsc$(TypeScriptSourceMap) @(TypeScriptCompile ->'"%(fullpath)"', ' ')" />
<Exec Command="tsc$(TypeScriptSourceMap) @(TypeScriptCompile ->'"%(fullpath)"', ' ')" />
<Exec Command="tsc --out all.js @(TypeScriptCompile ->'"%(fullpath)"', ' ')" />
</Target>