TrevorBurnham/snockets — pull request #42 by pthrasher (2013-04-26 18:20:30+00:00)
Title: SourceMap support / CoffeeScript upgrade / UglifyJS upgrade

First and foremost, this is a pretty big PR. I get that, and I get that large PR's with big changes are generally not something looked kindly upon.

I needed the following changes for my own projects, and once I put them in place, I thought I'd offer you the opportunity to merge them in if you wanted, instead of further fragmenting the "sprockets-like" packages on npm.

SourceMaps are now supported, and they all map back to the original source files, not to a concatenated file. Additionally, if you compiled a coffeescript file, the sourcemap points to the coffeescript, not the compiled javascript -- even when you minify the resulting javascript.

In order to acheive this, I had to refactor the getConcatenation code, update uglifyjs to version 2 (to get source map support) and update coffee-script to latest to get sourcemap support there as well.

I added a unit test to ensure sourcemaps are generated properly, but there could probably be a few more unit tests added around minify and the coffee compile function. Both of which have quite a bit more logic in then than they did before.

All the tests pass, so original expected behavior as far as test coverage remains unchanged.

Again, I understand this is a very large PR, and my feelings certainly won't be hurt if you decide you don't want to pull this in at all. However, I'd prefer to not have to maintain my own fork on github and npm.