Click here to Skip to main content
15,895,142 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi All,

In minification process,it will remove comments and spaces from CSS and js files.
how the tool work?
It will read the entire file to find comments,spaces and remove that lines or else how it will work background?

Any one can help on this.


Thanks
Posted
Comments
ZurdoDev 9-Oct-15 8:21am    
Yes, it removes the lines that are commented out and removes white space.

1 solution

It first removes \r and \n. Then replace all other control characters,Tabs and spaces also.
It removes all single line and multi-line comments (// and /*/)
Also replaces all kind of spaces with single space.
All runs of line feeds are replaced with single linefeed.
Also replace variable name like it will replace long variable name to very short name(E.g,var declarevariable; to very simple var a;)
Thus it reduces size and helps to increase performance.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900