Embedding Project with Typescript into another project
<p>I have a Visual Studio project that uses Typescript. This projects gets compiled into a dll and then referenced in the main project. This works fine for all normally compiled files, but I am hitting an issue when it comes to transpiled javascript files.</p>

<p>The sub project has the following in the .csproj file</p>

<pre><code>&lt;Target Name="AfterClean"&gt;
    &lt;ItemGroup&gt;
      &lt;EmbeddedResource Include="**\*.html;**\*.cshtml;**\*.css;**\*.js;**\*.map;**\*.jpg;**\*.png" /&gt;
    &lt;/ItemGroup&gt;
  &lt;/Target&gt;
</code></pre>

<p>This will include the .js files in the project when a Rebuild Solution is run, but it will not include the .js files when a normal build or a "Run" from Visual studio is used.</p>

<p>I believe the issue is to do with timings, I want the embedding to occur after the typescript transpile has happened, but before the dll is included in the main project. </p>

<p>I have tried the following options "BeforeBuild", "AfterBuild", "BeforeResolveReference", "AfterResolveReferences", "BeforeResGen" and "AfterResGen". - Found from a msdn article <a href="https://msdn.microsoft.com/en-GB/library/ms366724.aspx" rel="nofollow">here</a></p>

<p>Ideally I would like to add a DependsOnTargets=TypeScript compile to my embedding task so it forced the embed to happen after the transpile, but the typescript compile does not appear to be a target as it just appears like this in the .csproj file, so I don't believe this is possible</p>

<pre><code>&lt;ItemGroup&gt;
    &lt;TypeScriptCompile Include="app\app.module.ts" /&gt;
    ...
 &lt;/ItemGroup&gt;
</code></pre>

<p>Any ideas would be greatly appreciated </p>

<p>(I am using Visual Studio 2015 Update 3 and Typescript 1.8)</p>

<p>EDIT: The build server does not have tsc on the PATH so I am unable to call tsc from a prebuild event</p>