MSBUILD YUI

Aug 19, 2014 at 9:47 AM
Edited Aug 19, 2014 at 9:47 AM
Hi,


I have used a MSBUILD task to minify javascript files.

 <JavaScriptCompressorTask
          SourceFiles="@(JavaScriptFiles)"
          DeleteSourceFiles="false"
          OutputFile="$(SourceFileRootFolder)\$(WebFolder)\Javascript_Min\%(JavaScriptFiles.FileName).js"
          CompressionType="Standard"
          ObfuscateJavaScript="True"
          PreserveAllSemicolons="False"
          DisableOptimizations="No"
          EncodingType="Default"
          LineBreakPosition="-1"
          LoggingType="Info"
          ThreadCulture="en-gb"
          IsEvalIgnored="false"
            />
but the files are only compressed (white space removed), no renaming of variable names happen, please advice what needs to be set in order to rename the variables too.
Coordinator
Aug 19, 2014 at 10:57 AM
Hi,

Please attach a small example showing the input and the output, thanks.
Aug 19, 2014 at 12:10 PM
Edited Aug 19, 2014 at 12:14 PM
hi, sorry the code works perfectly, seems i was seeing the global variables and since they were not obfuscated i thought the variables are not getting changed.
Coordinator
Aug 19, 2014 at 12:15 PM
err...what code? I've asked you to attach a small example showing your input and your output, displaying the problem.
I haven't got anything to show you because I haven't seen the problem yet...
Coordinator
Aug 19, 2014 at 12:25 PM
@freeranger - it's all good, @consoleart said it's all working fine. 'the code' is the YUIC.NET package, he/she was mentioning.

also @consoleart - a unit test which tests obfuscation vs no-obfuscation is found here.
Coordinator
Aug 19, 2014 at 12:31 PM
Ah no, consoleart said "hi, no attachment, where do i see the code?" and I replied to that and he then changed his message while I was replying :)

@consoleart, I suspected it was the case that you were dealing with globals, which is why I wanted to see some example code - I knew we had obfuscation tests kicking around somewhere, so it was unlikely it was broken....
Coordinator
Aug 19, 2014 at 12:34 PM
Ahh! gotcha :)


Image
Aug 19, 2014 at 12:46 PM
thanks guys, all is well now... :-)