Bugfix for Mavention Assets Minifier for Visual Studio 2013 and 2012

Bugfix for Mavention Assets Minifier for Visual Studio 2013 and 2012

A while ago Waldek Mastykarz released a version of the Mavention Asset Minifier for Visual Studio 2013. A neat little plugin that helps you minifying your CSS and JavaScript files. Minifying JavaScript and CSS files are a proven optimization technique and with the introduction of apps minification of these files is becoming more important.

However after using this plugin for all of our apps over the last few months we found a minor glitch. In a specific case our minified file did break, and with some debugging we figured it had to do with the localization. If you would minify the following snippet

if (valuetoCheck > 7.5) { valueToSet = "somevalue"; }

The minified result would be

if (a > 7,5) { b = "7_5"; }

As you can see the decimal separator (.) got replaced by a comma (,) and that will break your minified script version as the comma is an operator.

Having identified the issue Waldek and I figured out that it probably had something to do with localization. We therefore decided that we should release a new version that could fix that problem. So I spend some time in implementing support for both localization and encoding of the output. As of today the latest version will support the use of points in your numbers as well as the use of special characters (as pointed out by Anatoly Mironov there was an issue with Chinese characters as well). But after implementing the some logic the output files now get encoded as an UTF-8 file, so the output will be something like: 

var specialSigns="通通通他体业"

That will get minified correctly to:

var a="通通通他体业"

And thus I am proud to let you know that we released a new version of both versions, so go ahead and download the Mavention SharePoint Assets Minifier for Visual Studio 2012 or the Mavention SharePoint Assets Minifier for Visual Studio 2013.

You can find some more information regarding the workings of these products on the blog post Bugfix release for Mavention SharePoint Assets Minifier for Visual Studio 2012 and 2013 or the original post Minifying JavaScript and CSS files made easy with Mavention SharePoint Assets Minifier.

Leave a Reply