HTML minification using WebMarkupMin in ASP.NET Core,you can Minifying razor templates or Minifying HTML at runtime.
Minifying Inline Css, Js and Html using WebMarkupMin in ASP.NET Core
This article will also demonstrate how the ASP.NET Core framework can be modified to match your requirements, creating new conventions and service implementations that you can easily include when composing your application.