In Visual Studio Go to Tools >> NuGet Package Manager >> Package Manager Console and run the below command. It will install the latest Package available.
PM> Install-Package AjaxMin
Nuget URL: https://www.nuget.org/packages/AjaxMin
JavaScript and CSS files minified with Ajax Minifier should work same as without minification.
If your file doesn’t work after minification,
First check to see if your JavaScript code contains eval statements that might require you to use a different –evals switch.
Example:-
Before Minification
var a= 1; if(a==5) { alert(5); } else if(a==1) { alert(1) }
After Minification
var a=1;a==5?alert(5):a==1&&alert(1)
When using Minification, Try to avoid the following :
- Global Variables and Functions
- Using Eval() Function
- With Statement
No comments