While minifying my project using the AjaxMin.dll with the default settings on every build/deployment, I ran into a problem. One of our third-party JavaScript files contains an eval statement that references variables or parameters which, when minified, causes errors in production. So now I realize I need to choose safer settings for the minification process.
The documentation for AjaxMin is not very clear. You can find it here: http://www.asp.net/ajaxlibrary/AjaxMinWithAndEval.ashx
I am using the code (with the DLL) and not the command line. The CodeSettings class has an EvalTreatment option but I am unsure about the best choice...
According to Microsoft's documentation:
using System;
namespace Microsoft.Ajax.Utilities
{
public enum EvalTreatment
{
Ignore = 0,
MakeImmediateSafe = 1,
MakeAllSafe = 2,
}
}
I'm considering either MakeImmediateSafe(1) or MakeAllSafe(2). What do you think?
Any suggestions would be greatly appreciated!