TypeScript settings in csproj

Posted by Joe Enos on August 18, 2021 · 1 min read

These are the settings I put in the csproj file for TypeScript – it sets values to convert to ES5, takes all TypeScript files and compiles to individual JavaScript files in the /Scripts/js directory. From there, I’ll bundle them into a single site.js file inside of wwwroot/js using BunderMinifier.

<PropertyGroup>
<TypeScriptTarget>ES5</TypeScriptTarget>
<TypeScriptJSXEmit>None</TypeScriptJSXEmit>
<TypeScriptModuleKind>CommonJS</TypeScriptModuleKind>
<TypeScriptCompileOnSaveEnabled>True</TypeScriptCompileOnSaveEnabled>
<TypeScriptNoImplicitAny>True</TypeScriptNoImplicitAny>
<TypeScriptNoExplicitAny>False</TypeScriptNoExplicitAny>
<TypeScriptRemoveComments>False</TypeScriptRemoveComments>
<TypeScriptOutFile></TypeScriptOutFile>
<TypeScriptOutDir>Scripts/js</TypeScriptOutDir>
<TypeScriptGeneratesDeclarations>False</TypeScriptGeneratesDeclarations>
<TypeScriptNoEmitOnError>True</TypeScriptNoEmitOnError>
<TypeScriptSourceMap>True</TypeScriptSourceMap>
<TypeScriptMapRoot />
<TypeScriptSourceRoot />
</PropertyGroup>