Merge pull request #25256 from dotnet/prkrishn/dotnet-watch
Allow dotnet watch to refresh on changes to .razor files in reference…
This commit is contained in:
commit
f891c2b15d
|
|
@ -78,6 +78,11 @@ Copyright (c) .NET Foundation. All rights reserved.
|
|||
This property affects C# projects targeting 3.0 or later.
|
||||
-->
|
||||
<RazorUpToDateReloadFileTypes>.cs;.razor;.resx;.cshtml</RazorUpToDateReloadFileTypes>
|
||||
|
||||
<!--
|
||||
Target used by dotnet-watch to resolve additional items.
|
||||
-->
|
||||
<CustomCollectWatchItems>$(CustomCollectWatchItems);_RazorSdkCustomCollectWatchItems</CustomCollectWatchItems>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup Condition="'$(EnableDefaultItems)' == 'true' And '$(EnableDefaultContentItems)' == 'true'">
|
||||
|
|
|
|||
|
|
@ -327,12 +327,6 @@ Copyright (c) .NET Foundation. All rights reserved.
|
|||
-->
|
||||
<UpToDateCheckBuilt Include="@(RazorIntermediateAssembly)"
|
||||
Condition="'$(RazorCompileOnBuild)'=='true' AND '@(Content->WithMetadataValue('Extension', '.cshtml'))' != ''" Set="RazorViews" />
|
||||
|
||||
<!-- Set up watchers for dotnet-watch -->
|
||||
<Watch Include="@(Content->WithMetadataValue('Extension', '.razor'))" />
|
||||
|
||||
<Watch Include="@(Content->WithMetadataValue('Extension', '.cshtml'))"
|
||||
Condition="'$(_Targeting30OrNewerRazorLangVersion)' == 'true' AND '$(AddCshtmlFilesToDotNetWatchList)' != 'false'" />
|
||||
</ItemGroup>
|
||||
|
||||
<!--
|
||||
|
|
@ -870,6 +864,15 @@ Copyright (c) .NET Foundation. All rights reserved.
|
|||
</PropertyGroup>
|
||||
</Target>
|
||||
|
||||
<Target Name="_RazorSdkCustomCollectWatchItems">
|
||||
<ItemGroup>
|
||||
<Watch Include="%(Content.FullPath)" Condition="'%(Content.Extension)' == '.razor' AND '%(Content.Watch)' != 'false'" />
|
||||
<Watch Include="%(Content.FullPath)" Condition="'%(Content.Extension)' == '.razor.css' AND '%(Content.Watch)' != 'false'" />
|
||||
<Watch Include="%(Content.FullPath)"
|
||||
Condition="'$(_Targeting30OrNewerRazorLangVersion)' == 'true' AND '$(AddCshtmlFilesToDotNetWatchList)' != 'false' AND '%(Content.Extension)' == '.cshtml' AND '%(Content.Watch)' != 'false'" />
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
<PropertyGroup Condition="'$(RazorDesignTimeTargets)'==''">
|
||||
<RazorDesignTimeTargets>$(MSBuildExtensionsPath)\Microsoft\VisualStudio\Razor\Microsoft.NET.Sdk.Razor.DesignTime.targets</RazorDesignTimeTargets>
|
||||
<RazorDesignTimeTargets Condition="!Exists('$(RazorDesignTimeTargets)')">$(MSBuildThisFileDirectory)Microsoft.NET.Sdk.Razor.DesignTime.targets</RazorDesignTimeTargets>
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ Returns: @(Watch)
|
|||
</_CollectWatchItemsDependsOn>
|
||||
<_CollectWatchItemsDependsOn Condition=" '$(TargetFramework)' != '' ">
|
||||
_CoreCollectWatchItems;
|
||||
$(CustomCollectWatchItems);
|
||||
</_CollectWatchItemsDependsOn>
|
||||
</PropertyGroup>
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
.net
|
||||
Loading…
Reference in New Issue