I am building a web application for mobile using visual studio, and I wanted to know how do I minify all my CSS files into one file, and also all my JavaScript to one minified file.
A Minify button should appear in the status bar when opening a . js or a . css file. You can also run Minify: Document by clicking F1 or CTRL+SHIFT+P .
Click on wwwroot folder, select the css file you want minified, then right click and choose bundler & minifier. Then from popup minify file. It will be the same file name with the minified version.
You can use the Visual Studio 2015 Bundler & Minifier,extention https://visualstudiogallery.msdn.microsoft.com/9ec27da7-e24b-4d56-8064-fd7e88ac1c40 this used to be apart of Web Essentials in previous versions of Visual Studio, but was separated, into it's own extension.
The below link explains a lot better http://blogs.msdn.com/b/rickandy/archive/2012/08/15/adding-web-optimization-to-a-web-pages-site.aspx
http://www.asp.net/mvc/overview/performance/bundling-and-minification
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With