I declare the following javascript
window.myApp = {};
myApp.myVeryLongFunctionName = function()
{
...
};
Then I minify the javascript with the following (in C#)
var minifiedCode = minifier.MinifyJavaScript(code, new CodeSettings
{
RemoveUnneededCode = true,
PreserveImportantComments = false,
LocalRenaming = LocalRenaming.CrunchAll,
EvalTreatment = EvalTreatment.MakeAllSafe,
OutputMode = OutputMode.SingleLine,
PreserveFunctionNames = false
});
But "myApp" and "veryLongFunctionName" doesn't get shorted, it gets minfied to this.
window.myApp={};myApp.myVeryLongFunctionName=function(){};
I would the code to be minified to something like this.
window.a={};a.b=function(){};
What code settings parameters do I need to achieve this?
MinifyJavaScript()
returns the minified code as a string. Try this: