MSBuild 输出缺少 Typescript 编译的 javascript 文件 [英] MSBuild output missing javascript files compiled by Typescript

查看:65
本文介绍了MSBuild 输出缺少 Typescript 编译的 javascript 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在 CI 服务器上使用 MSBuild 来编译我们的 WebApp,但是该构建在构建的输出中省略了由 TypeScript 构建的 JavaScript 文件.

We use MSBuild on our CI server to compile our WebApp, however the build omits the JavaScript files built by TypeScript from the output of the build.

我希望输出包含 JavaScript 而不是 Typescript,但两者都不是在预期位置的输出中.

I would expect the output to contain the JavaScript and not the Typescript, however neither are in the output at the expected locations.

如何在我的解决方案中包含 JavaScript 文件而不必将它们全部包含在内?TypeScript 团队似乎认为这很糟糕,但我也不想在我的解决方案中包含所有文件的重复项.

How can I include the JavaScript files without having to have them all in my solution? The TypeScript team seems to think this is bad, but I would rather not have duplicates of all the files in my solution either.

推荐答案

问题似乎是由于在构建服务器上使用 MSBuild 而不是发布".我在内容中添加了一个 AfterBuild 目标,将所有 JS 文件包含在构建输出中.

The problem was due to using MSBuild instead of the "Publish" on the build server it seems. I added an AfterBuild target to content include all of the JS files to the build output.

<Target Name="AfterBuild">
   <ItemGroup>
      <Content Include="**\*.js" />
   </ItemGroup>
</Target>

虽然这并不理想,但它允许 js 文件在使用 Visual Studio 时不显示在解决方案中,并且文件最终会出现在构建输出中.

Although this is not ideal, it allows the js files not to show in the solution when using visual studio and the files end up in the build output.

这篇关于MSBuild 输出缺少 Typescript 编译的 javascript 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆