SquishIt ForceRelease in MVC3 doesn't minify JQuery plugins correctly

I am getting tons of errors when using SquishIt in my MVC3 app with 3rd party JQuery plugins. On my development machine, if I set the ForceDebug method in the Bundle command, everything works fine and the JS is processed as usual. However, if I set the ForceRelease method (before testing before going to production) when I host the site, FireFox displays "not a function" errors. I tried setting compilation debug="true"

in web.config with no improvement.

Here are the JS calls in my _layout.cshtml file. All packages for standard jQuery plugins:

<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.9/jquery.validate.min.js"></script>
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/mvc/3.0/jquery.validate.unobtrusive.min.js"></script>
<script type="text/javascript" src="@Url.Content("~/Scripts/jquery-ui-1.8.18.custom.min.js")"></script>
@(Bundle.JavaScript()
    .Add("~/Scripts/modernizr-2.5.3.js")
    .Add("~/Scripts/jquery.fileinput.js")
    .Add("~/Scripts/jquery.numeric.js")
    .Add("~/Scripts/jquery.maskedinput-1.3.min.js")
    .Add("~/Scripts/jquery.maxlength_countdown.js")
    .Add("~/Scripts/jquery.qtip.min.js")
    .Add("~/Scripts/jquery.pnotify-1.1.0.min.js")
    .Add("~/Scripts/fileuploader.js")
    .Add("~/Scripts/jquery.dropdownchecklist-1.4.js")
    .Add("~/Scripts/jquery.blockUI.js")
    .Add("~/Scripts/jquery.textarearesizer.min.js")
    .ForceRelease()
    .MvcRender("~/CompiledContent/combined_#.js")
  )

      

Here is an example of errors displayed by FireFox. It depends on what I included in the kit:

function (n) {var i = (n.browser.msie ? "paste" : "input") + ".mask", t = window.orientation != undefined;n.mask = {definitions: {9: "[0-9]", a: "[A-Za-z]", '*': "[A-Za-z0-9]"}, dataName: "rawMaskFn"}, n.fn.extend({caret: function (n, t) {if (this.length != 0) {if (typeof n == "number") {return t = typeof t == "number" ? t : n, this.each(function ()

... YADDA YADDA YADDA - 50 more lines of script here ... function () {setTimeout(i, 0);})();}).bind("blur.mask", function () {v(), c.val() != p && c.change();}).bind("keydown.mask", nt).bind("keypress.mask", d).bind(i, function () {setTimeout(function () {c.caret(v(true));}, 0);}), v();});}});}(jQuery) is not a function

$(".dropdown-checklist").dropdownchecklist is not a function

Any thoughts on what I might have screwed up here?

+3


source to share


1 answer


We ran into something similar before ... found out that one of the files did not have a semicolon at the end of the javascript function. This caused all kinds of chaos. The function works great when it's a file on its own, but after combining it, the semicolon makes a difference.



You can also set Minifier to null Minifier and view the output it generates. This can help troubleshoot some issues.

+8


source







All Articles