After we have the seen the core minification process, I will show you the code of both CssMinifierTagHelper and JavaScriptTagHelper that allow us to minifiy both inline styles and scripts as well as external files if it needs.

For sake of the demo I didn't implement kind of watchers to monitor if some of the external styles or scripts change to minify them again, but this is totally possibly with the newly File System APIs in ASP.NET Core.

Finally I hope this post will give you some thoughts of how to start with your own custom tag helper.

You can download the source code for this post from my MinifiersTagHelpers repository on GitHub.