When installing the latest version of the Microsoft.AspNet.Web.Optimization
package (before the Microsoft.Web.Optimization package)
I noticed a dependency on an assembly called WebGrease.
So I started to look around what it is and found the following 2 blog posts:
What is WebGrease?
The features the initial version includes are:
- Creation of image sprites from images reference in CSS files.
- Auto-version naming of files.
In order to use all of the features in WebGrease, there is a command line tool included with the nuget package(WG.exe).
wg.exe <operation switch> -in:<input file/folder> -out:<output file/folder>
The valid operation switches of WG.exe are:
- -m : Invokes the minification operation on the file(s).
- -s : Processes css file(s) for images and will attempt to create a image sprite out of them, and create updated copies of the css file(s).
- -b : Bundles files together into a single output file.
- -a : This switch will rename files based on their content (hash), and generate a lookup xml file for mapping between the original name and new name.