Allow dotnet-watch to look for changes to .razor.css files (#25792)
Fixes https://github.com/dotnet/aspnetcore/issues/25483
This commit is contained in:
parent
bfc1ec6792
commit
ab5dfe5374
|
|
@ -275,5 +275,17 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
|
||||||
Assert.BuildPassed(result);
|
Assert.BuildPassed(result);
|
||||||
Assert.BuildOutputContainsLine(result, $"RazorTasksPath: {expected}");
|
Assert.BuildOutputContainsLine(result, $"RazorTasksPath: {expected}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
[InitializeTestProject("ComponentApp")]
|
||||||
|
public async Task IntrospectRazorSdkWatchItems()
|
||||||
|
{
|
||||||
|
// Arrange
|
||||||
|
var result = await DotnetMSBuild("_IntrospectWatchItems");
|
||||||
|
|
||||||
|
Assert.BuildPassed(result);
|
||||||
|
Assert.BuildOutputContainsLine(result, "Watch: Index.razor");
|
||||||
|
Assert.BuildOutputContainsLine(result, "Watch: Index.razor.css");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -877,7 +877,7 @@ Copyright (c) .NET Foundation. All rights reserved.
|
||||||
<Target Name="_RazorSdkCustomCollectWatchItems">
|
<Target Name="_RazorSdkCustomCollectWatchItems">
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Watch Include="%(Content.FullPath)" Condition="'%(Content.Extension)' == '.razor' AND '%(Content.Watch)' != 'false'" />
|
<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="%(None.FullPath)" Condition="$([System.String]::Copy('%(None.FullPath)').EndsWith('.razor.css')) AND '%(None.Watch)' != 'false'" />
|
||||||
<Watch Include="%(Content.FullPath)"
|
<Watch Include="%(Content.FullPath)"
|
||||||
Condition="'$(_Targeting30OrNewerRazorLangVersion)' == 'true' AND '$(AddCshtmlFilesToDotNetWatchList)' != 'false' AND '%(Content.Extension)' == '.cshtml' AND '%(Content.Watch)' != 'false'" />
|
Condition="'$(_Targeting30OrNewerRazorLangVersion)' == 'true' AND '$(AddCshtmlFilesToDotNetWatchList)' != 'false' AND '%(Content.Extension)' == '.cshtml' AND '%(Content.Watch)' != 'false'" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,10 @@
|
||||||
<Message Text="Content: %(Content.Identity) CopyToOutputDirectory=%(Content.CopyToOutputDirectory) CopyToPublishDirectory=%(Content.CopyToPublishDirectory) ExcludeFromSingleFile=%(Content.ExcludeFromSingleFile)" Importance="High" />
|
<Message Text="Content: %(Content.Identity) CopyToOutputDirectory=%(Content.CopyToOutputDirectory) CopyToPublishDirectory=%(Content.CopyToPublishDirectory) ExcludeFromSingleFile=%(Content.ExcludeFromSingleFile)" Importance="High" />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
|
<Target Name="_IntrospectWatchItems" DependsOnTargets="_RazorSdkCustomCollectWatchItems">
|
||||||
|
<Message Text="Watch: %(Watch.FileName)%(Watch.Extension)" Importance="High" />
|
||||||
|
</Target>
|
||||||
|
|
||||||
<Target Name="_IntrospectRazorTasks">
|
<Target Name="_IntrospectRazorTasks">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<_SdkTaskPath>$([System.IO.Path]::GetFullPath('$(RazorSdkBuildTasksAssembly)'))</_SdkTaskPath>
|
<_SdkTaskPath>$([System.IO.Path]::GetFullPath('$(RazorSdkBuildTasksAssembly)'))</_SdkTaskPath>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue