Skip to content

Commit df26349

Browse files
committed
Fix build bugs
1 parent cdc8f5c commit df26349

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Components/Blazor/Build/src/targets/StaticWebAssets.targets

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@
3838

3939
<_ContentLinkedIntoWwwroot
4040
Include="@(_ContentWithWwrootLinkAttribute)"
41-
Condition="'%(CopyToPublishDirectory)' != 'false'">
41+
Condition="@(_ContentWithWwrootLinkAttribute) != '' and '%(CopyToPublishDirectory)' != 'false'">
4242
<!-- This gets rid of wwwroot\ -->
4343
<RelativePath>$([System.String]::Copy('%(Link)').Substring(8))</RelativePath>
4444
</_ContentLinkedIntoWwwroot>
4545

46-
<_OutsideContentLinkedIntoWwwroot Include="@(_ContentLinkedIntoWwwroot->'%(FullPath)')" Condition="!$([System.String]::Copy('%(Identity)').Replace('\','/').StartsWith('wwwroot/'))" />
47-
<_WwwrootLinkedContent Include="@(_ContentLinkedIntoWwwroot->'%(FullPath)')" Condition="$([System.String]::Copy('%(Identity)').Replace('\','/').StartsWith('wwwroot/'))" KeepMetadata="RelativePath" />
46+
<_OutsideContentLinkedIntoWwwroot Include="@(_ContentLinkedIntoWwwroot->'%(FullPath)')" Condition="@(_ContentLinkedIntoWwwroot) != '' and !$([System.String]::Copy('%(Identity)').Replace('\','/').StartsWith('wwwroot/'))" />
47+
<_WwwrootLinkedContent Include="@(_ContentLinkedIntoWwwroot->'%(FullPath)')" Condition="@(_ContentLinkedIntoWwwroot) != '' and $([System.String]::Copy('%(Identity)').Replace('\','/').StartsWith('wwwroot/'))" KeepMetadata="RelativePath" />
4848

4949
<!-- For content items with the Link attribute on them, we update the relative path. This enables support at publish time for these assets but forgoes any
5050
dev-time support. (If you want to have dev-time support, you need to add an appropriate file into the wwwroot folder with CopyToPublishDirectory="false")
@@ -70,7 +70,7 @@
7070
* We do guarantee that we will copy them into the actual wwwroot folder at publish time.
7171
* If you want this type of dev-time support, the recomendation is to add the list of assets to the item group manually indicating a suitable content root.
7272
-->
73-
<StaticWebAsset Include="@(_OutsideContentLinkedIntoWwwroot)">
73+
<StaticWebAsset Include="@(_OutsideContentLinkedIntoWwwroot)" Condition="@(_OutsideContentLinkedIntoWwwroot) != ''">
7474
<SourceType></SourceType>
7575
<SourceId>$(PackageId)</SourceId>
7676
<!-- We don't try to come up with a separate content root to make the inner loop work.

0 commit comments

Comments
 (0)