A bit of background... I'm setting up my new site's base template and I'm including some popular javascript libraries, such as AngularJS, Bootstrap's javascript files, and Underscore.js. Of course I wrap these files in {% compress js %}. Example code below:
{% compress js %}
<script src="{{ STATIC_URL }}new_js/vendor/modernizr-2.6.2-respond-1.1.0.min.js"></script>
<script>window.jQuery || document.write('<script src="{{ STATIC_URL }}new_js/vendor/jquery-1.8.3.min.js"><\/script>');</script>
<script src="{{ STATIC_URL }}new_js/vendor/bootstrap.js"></script>
<!-- Angular -->
<script src="{{ STATIC_URL }}new_js/vendor/angular.min.js"></script>
<script src="{{ STATIC_URL }}new_js/angular/directives.js"></script>
<script src="{{ STATIC_URL }}new_js/angular/services.js"></script>
<script src="{{ STATIC_URL }}new_js/vendor/underscore-1.4.3.min.js"></script>
{% block extra_js %}{% endblock %}
{% endcompress %}
I know django-compressor only runs the minification filters, so it's probably the minifiers not generating the correct Javascript output.
Here is the JS error I get with JSMin:
SyntaxError: invalid increment operand
http://localhost:8000/site_media/static/cache/js/0f5eb5fb3b24.js
Line 448
And the error from the file generated by SlimIt:
SyntaxError: missing ; after for-loop initializer
http://localhost:8000/site_media/static/cache/js/7fbdf61f5abb.js
Line 1
I'm not entirely sure what's going on here, it seems hard to believe the minifiers would generate incorrect files on these common js libraries.
Has anyone run into problems with django-compressor's Javascript filters messing up common libraries?