Skip to content

Commit 02cf642

Browse files
authored
feat(templates): improve razor.css cleanup in boilerplate #10955 (#10956)
1 parent 6198ee8 commit 02cf642

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Templates/Boilerplate/Bit.Boilerplate/src/Directory.Build.props

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,17 +78,17 @@
7878
<Watch Remove="*.scss" />
7979
</ItemGroup>
8080

81-
<!-- Deletes razor.css files that lack a corresponding razor.scss file in the project before the build process.
81+
<!-- Deletes *.razor.css files that lack a corresponding .razor file in the project before the build process.
8282
This is necessary in Blazor projects with Scoped CSS to prevent build errors caused by orphaned razor.css files,
83-
which may remain after their source razor.scss files are deleted or renamed. For example, if a developer deletes
84-
a razor.scss file and commits the change to Git, another developer who pulls the updated repository will have the
85-
razor.scss file removed from their system, but the generated razor.css file may remain.
83+
which may remain after their source razor files are deleted or renamed. For example, if a developer deletes
84+
a razor, razor.cs and razor.scss files and commits the change to Git, another developer who pulls the updated repository will have the
85+
razor, razor.cs and razor.scss file removed from their system, but the generated razor.css file may remain.
8686
This orphaned razor.css file can cause build errors in the ApplyCssScopes task.
8787
The following target ensures such files are deleted before the build, maintaining consistency and preventing errors. -->
8888
<Target Name="DeleteUnmatchedRazorCss" BeforeTargets="ComputeCssScope">
8989
<ItemGroup>
9090
<RazorCssFiles Include="**\*.razor.css" />
91-
<UnmatchedRazorCssFiles Include="@(RazorCssFiles)" Condition="!Exists('%(RecursiveDir)%(FileName).scss')" />
91+
<UnmatchedRazorCssFiles Include="@(RazorCssFiles)" Condition="!Exists('%(RecursiveDir)%(FileName)')" />
9292
</ItemGroup>
9393
<Delete Files="@(UnmatchedRazorCssFiles)" />
9494
</Target>

0 commit comments

Comments
 (0)