ASP.NET Core CSS Live Reloader
Summary
This is a yet another CSS live reloader for ASP.NET Core App as an ASP.NET Core middleware.
There are already many live reloading solutions.
However, instead of this middleware works for only CSS files, it reload styles more smoothly rather than other solutions.
How to use
- Add
Toolbelt.AspNetCore.CssLiveReloader
NuGet package reference to your ASP.NET Core Web App project.
dotnet add package Toolbelt.AspNetCore.CssLiveReloader
- After installing this package, what you have to do is just add one line
app.UseCssLiveReload();
in your startup code, like this:
...
using Toolbelt.Extensions.DependencyInjection; // <- Add this, and...
...
public class Startup
{
...
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
...
if (env.IsDevelopment())
{
...
app.UseCssLiveReload(); // 👈 Add this!
That's all!