【问题标题】:Azure DevOps & Bower - include bower_components in build packageAzure DevOps & Bower - 在构建包中包含 bower_components
【发布时间】:2019-09-11 15:01:53
【问题描述】:

我在 Azure DevOps 上有以下管道

一切都按预期工作,但是我很困惑如何在我的构建包中包含 bower_components 文件夹,因为 MsBuild 不知道 bower 文件夹。

我成功地将包下载到 bower_components 文件夹,但是我不知道如何将文件夹包含在我的最终包中的推荐方式。

【问题讨论】:

    标签: msbuild azure-devops bower


    【解决方案1】:

    通过将其添加到我的 .csproj 文件中解决:

      <Target Name="AddBowerComponents" BeforeTargets="CopyAllFilesToSingleFolderForPackage;CopyAllFilesToSingleFolderForMsdeploy">
        <Message Text="Adding bower components" Importance="high"/>
        <ItemGroup>
          <CustomFilesToInclude Include=".\bower_components\**\*.*" />
          <FilesForPackagingFromProject  Include="%(CustomFilesToInclude.Identity)">
            <DestinationRelativePath>.\bower_components\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
          </FilesForPackagingFromProject>
        </ItemGroup>
      </Target>
    

    【讨论】:

    • 太棒了!感谢您在此处分享您的解决方案,您可以接受它作为答案,这样它可以帮助遇到相同问题的其他社区成员,我们可以归档这个帖子,谢谢。
    猜你喜欢
    • 2019-04-20
    • 2013-09-18
    • 1970-01-01
    • 1970-01-01
    • 2020-01-09
    • 2013-06-14
    • 1970-01-01
    • 1970-01-01
    • 2021-09-28
    相关资源
    最近更新 更多