-
-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathDirectory.Build.targets
More file actions
29 lines (27 loc) · 1.13 KB
/
Copy pathDirectory.Build.targets
File metadata and controls
29 lines (27 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<Project>
<PropertyGroup>
<BuildDependsOn>TriggerESBuild;RemoveStaleJsContent;$(BuildDependsOn)</BuildDependsOn>
</PropertyGroup>
<!-- After ESBuild runs (which may delete old chunk files), remove any Content items
whose backing files no longer exist. Without this, DefineStaticWebAssets fails
trying to resolve files that were globbed during project evaluation but deleted
by ESBuild cleanup. See dotnet/sdk#49988. -->
<Target Name="RemoveStaleJsContent">
<ItemGroup>
<Content Remove="@(Content)"
Condition="'%(Content.Extension)' == '.js' and !Exists('%(FullPath)')" />
<Content Remove="@(Content)"
Condition="'%(Content.Extension)' == '.map' and !Exists('%(FullPath)')" />
</ItemGroup>
</Target>
<ItemGroup>
<None Update="Scripts\**\*"
Watch="false" />
<Content Update="Scripts\**\*"
Watch="false" />
<None Update="wwwroot\**\*"
Watch="false" />
<Content Update="wwwroot\**\*"
Watch="false" />
</ItemGroup>
</Project>