Here I'm going to post whatever that is interesting for me. All things about programming using JavaScript and ASP.NET Core. And something else.

A blog about ASP.Net Core and JavaScript

Tagged with PostCSS

A few days ago I realized that stylesheet on one of my sites wasn't minified. The quick investigation showed that minify option of the webpack css-loader didn’t work anymore. I researched this problem and found that since version 1.0.0 the css-loader doesn't contain the minimize option (see changelog).

In this post, I will show how to keep your CSS minimized by using the PostCSS loader with cssnano.

I will use the Asp.Net Core project, configured as showed in one of my previous posts “Using webpack 4 with ASP.NET Core 2.x MVC application to process ES6 scripts and SASS styles” and will modify it in a proper way.

So, let’s do it.