Tuesday, January 12, 2016

How to minify the javascript and css files that often changes

In this section, let us see about how to minify the javascipt and css files.

It is tough for the developers to work/modify with the minified versions of .js and .css files. The code needs to be well formatted, commented and understandable by other developers also.

In MVC application, the normal .js and .css files are referred for better understanding and debugging.
But during deployment, the minified versions are referred for better performance.

We know, the minified .js or .css file will have no free spaces, comments and the variable/function names are mapped with less characters.

Consider the case, a small update is required on a existing .js file for a bug fix. The developer can easily update the normal file and it is hard to update the same changes in minified file version.

In Visual Studio, an Extension WebEssentials can be used to overcome these problems. Whenever you make a change in the normal file, the same changes are automatically applied in the minified version also.

Please refer the screens below to include the extension to your Visual Studio,



No comments:

Post a Comment