|
38 | 38 |
|
39 | 39 | <_ContentLinkedIntoWwwroot
|
40 | 40 | Include="@(_ContentWithWwrootLinkAttribute)"
|
41 |
| - Condition="'%(CopyToPublishDirectory)' != 'false'"> |
| 41 | + Condition="@(_ContentWithWwrootLinkAttribute) != '' and '%(CopyToPublishDirectory)' != 'false'"> |
42 | 42 | <!-- This gets rid of wwwroot\ -->
|
43 | 43 | <RelativePath>$([System.String]::Copy('%(Link)').Substring(8))</RelativePath>
|
44 | 44 | </_ContentLinkedIntoWwwroot>
|
45 | 45 |
|
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" /> |
48 | 48 |
|
49 | 49 | <!-- 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
|
50 | 50 | 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 | 70 | * We do guarantee that we will copy them into the actual wwwroot folder at publish time.
|
71 | 71 | * 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.
|
72 | 72 | -->
|
73 |
| - <StaticWebAsset Include="@(_OutsideContentLinkedIntoWwwroot)"> |
| 73 | + <StaticWebAsset Include="@(_OutsideContentLinkedIntoWwwroot)" Condition="@(_OutsideContentLinkedIntoWwwroot) != ''"> |
74 | 74 | <SourceType></SourceType>
|
75 | 75 | <SourceId>$(PackageId)</SourceId>
|
76 | 76 | <!-- We don't try to come up with a separate content root to make the inner loop work.
|
|
0 commit comments