If you have *.scss files in a Styles folder in your project and you reference the AspNetCore.SassCompiler package directly, it should create a corresponding *.css file in the wwwroot\css folder.
These projects were referencing AspNetCore.SassCompiler v1.71.1.1 and using that version worked. However, if the consuming project referenced a newer version the *.css files got created and then immediately deleted. This appears to be a race condition between a cleanup task in our package which deletes the *.css files and the generation of the files.
This PR moves the cleanup task earlier in the build lifecycle, alongside other cleanup tasks. This gives it time to finish before the generation of new files happens, meaning that newer versions of AspNetCore.SassCompiler can be used. It upgrades our dependency to the latest.
We also generate a placeholder site.css for Umbraco projects if none exists, to avoid a 404 in the backoffice where we configure the rich text editor to load site.css so that it can display our custom styles. This PR improves the condition for generating that file, avoiding wasteful generation and any potential conflict if there is a Styles\site.scss file present which would replace it moments later.
If you have
*.scss
files in aStyles
folder in your project and you reference theAspNetCore.SassCompiler
package directly, it should create a corresponding*.css
file in thewwwroot\css
folder.These projects were referencing
AspNetCore.SassCompiler
v1.71.1.1 and using that version worked. However, if the consuming project referenced a newer version the*.css
files got created and then immediately deleted. This appears to be a race condition between a cleanup task in our package which deletes the*.css
files and the generation of the files.This PR moves the cleanup task earlier in the build lifecycle, alongside other cleanup tasks. This gives it time to finish before the generation of new files happens, meaning that newer versions of
AspNetCore.SassCompiler
can be used. It upgrades our dependency to the latest.We also generate a placeholder
site.css
for Umbraco projects if none exists, to avoid a 404 in the backoffice where we configure the rich text editor to loadsite.css
so that it can display our custom styles. This PR improves the condition for generating that file, avoiding wasteful generation and any potential conflict if there is aStyles\site.scss
file present which would replace it moments later.Fixes #300.