thumblemonks / smurf

Rails plugin to automatically minify JavaScript and CSS when their bundles get cached
http://gusg.us/code/ruby/smurf-rails-autominifying-js-css-plugin.html
MIT License
193 stars 12 forks source link

Bug fix: Added support for Conditional Compilation #10

Closed peppyheppy closed 13 years ago

peppyheppy commented 13 years ago

Hi, thanks for writing this gem... been using it for ages but it wasn't until recently when I tried to bundle the html5shiv (http://code.google.com/p/html5shiv/) js into my js cache that I ran into a bug.

html5shiv is using conditional compilation for Internet Explorer and because it is a comment in most browsers the whole file is omitted from the cached bundle. Now, javascript files that contain this special "comment" will be preserved.

Source of the victim js can be seen here: http://html5shiv.googlecode.com/svn/trunk/html5.js

I wrote a test for the main case and would love any feedback that you had for my contribution.

Thanks again for leading the charge with this very useful gem!

Cheers! Paul

gus commented 13 years ago

Thanks a ton! I'll take a look shortly when I have a few moments and apply and/or provide comments.

Also, thanks for using Smurf! I haven't been able to use it a lot lately which means I haven't needed to fix it. Any outside assistance is great.