Combining files with MS Minifier

Sep 29, 2011 at 1:51 PM

I haven't tried other combinations, but Chirpy seems to have an issue when combining multiple inline functions / libraries.  I'm not sure who is at fault, but when you combine to files that look like (function(){...})();  The ending ';' is removed from both files.  This is an error when they are combined.  It combines like... (function(){...})()(function(){...}(), but it should have had the ';' between the two files.  I sure hope this makes sense.  The new MS code when you pass it an XML file to combine files works correctly. 

Thanks for the great tool.  I hope this is something that can be resolved so that I can continue using it with our project.



Dec 18, 2011 at 1:54 AM

Test with : 

<FileGroup Name="mash.js"  Minify="False">
     <File Path="../scripts/jquery-1.4.4.js" Minify="True" MinifyWith="msAjax" />
     <File Path="../scripts/jquery-ui.js"  Minify="True"  MinifyWith="msAjax" />
Dec 18, 2011 at 2:12 AM

I'll test tomorrow, but... is the key to put on the FileGroup Minify="False"

When I had walked thru the code initially it looked like the issue was that each file is passed individually to ajaxmin.  This will cause the trailing semi-colon on the closure to be removed.

I'll let you know...

Dec 18, 2011 at 8:21 PM

I tested with the latest Beta release and it still fails.  The trailing semi-colon from each file is removed.  If you combine the files first and then minify them... it works appropriately.  This is the way I finally had to setup things in the my build.  I'm using Chirpy to do the combining of the files and then I have a build task that has ajaxmin compress them.

Thanks for looking at this.

Dec 18, 2011 at 10:46 PM

Go to config and check "terms semicolons"

Menu "Tools" > "options"

Item "Chirpy"

Sub item "Ms JS Ajax Minifier"

Dec 18, 2011 at 11:20 PM

No difference there's no semi-colon at the end of the jquery library between the next file.

Dec 19, 2011 at 1:24 AM

In Chirpy ver 2.03 have bug setting in "Ms Js Ajax minifier" and "Ms Css minifier" don't save.

Download last source code.

Dec 19, 2011 at 12:16 PM

I saw that in the source after testing.  I'll try to download and compile today.  Thanks again.  Love the tool and it will work great for what I'm trying to do with my javascript library.


Dec 19, 2011 at 8:13 PM

I downloaded and compiled the code.  After I installed it... it went into a endless loop about an Int16.  I didn't have time to look close because I'm working on a project at work.

Dec 20, 2011 at 3:41 AM

I compiled on a new VS 2010 setup and everything was fine until I checked the 'term' box and the clicked saved.  Then it went into a endless set of error dialogs with the following message -


Chrip - failed to load: LineBreak Threshold=Value was either too large or too small for an Int16.

Dec 23, 2011 at 8:03 PM
Edited Dec 23, 2011 at 8:08 PM

I looked at it closer today.  The problem has to do with the value initially stored in the registry for CSS and JS LineBreakThreshold.  For some reason it believes this value should be an Int16.  This value is a DWORD which is 32bit and of course the acceptable value is an int which is also 32bit for ajaxmin.  

Also... The threshold value by default should be set to a max value and not something so little as 50.  The max value from ajaxmin is Int32-1000.  In my testing... I set it to the max value of Int16.

Anyway... hopefully this can help you id where the expectation of the Int16 is coming from.


P.S - the ending term works. :-)

Dec 24, 2011 at 12:42 AM

I contributed the fixes and also added a new Preserve Important Comments MSJS option.

Dec 29, 2011 at 5:17 PM

Fix changeset:





Dec 30, 2011 at 2:58 PM

The merge on settings.cs wasn't correct.  Search the code for Int16 and replace with Int32.  You'll find it in the LoadOptionsFromRegistry routine.

Dec 30, 2011 at 8:16 PM


LoadOptionsFromRegistry routine
Int16 replace with Int32.