If I am using the WebOptimizer -- https://github.com/ligershark/WebOptimizer -- for bundling and minification in my ASP.Net Core application is there any need to keep the minified versions of the client-side libraries that are being used around?
For example, do I still need code like this in the layout page:
<environment include="Development">
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.css" />
</environment>
<environment exclude="Development">
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
</environment>
Or can I just have the link to the un-minified version and WebOptimizer will minify it on the fly and then I can delete the boostrap.min.css
file from my project?
And on a related note, what would the WebOptimizer middleware do if it encountered a pre-minified file?
This is a bit old but I thought it was good to answer this.
Instead of doing it on the HTML part of things, you could configure the bundle to minify the file or not in your configuration, and just reference bootstrap.css in your html normally.
Here you can find an example of how this is done: https://www.vinayjadav.com/posts/bundle-js-css-aspnet-core
And in your Program.cs (for .net core)