We generally write a Httphandler to remove white space from a CSS and JS file or we use minifies versions of CSS and JS files. Like in jQuery they give us a min version of a JS file.
Now we don't need to write any external utility to remove white space because now we have Chirpy, which is a Visual Studio Add-in for handling CSS, JS, DotLess and T4 files.
Now let me try to explain how to use this add in.
First go to http://nuget.org/packages/ChirpyVSI or http://chirpy.codeplex.com/ and download and install it.
See in the following image, there is much white space:
Now we will try to remove it using Chirpy.
Add a new config file inside the content folder. The file name would be Bundle.chirp.config and the content will be:
When you create the bundle file and filegroup and file path all are correct and then it will automatically generate it. It will look like:
Now you can see as in the following image that all white space has been removed from the CSS:
Note: You can use the same bundle file for JS also.