less/less.js — pull request #1774 by OliverJAsh (2014-01-03 18:10:05+00:00)
Title: Allow source map input

I am looking for a CSS minifier that can receive an input source map, minify
the CSS, and produce a new source map from the original. For example, when I
compile my CSS with LESS, it produces a source map. A separate task might then
minify my compiled CSS, but I want to the minified CSS to be mapped to the
original LESS source files.

LESS is currently the only CSS minifier that is able to produce a source map.
This is because it appears to be the only minifier that uses an AST. In my use
case, I would like to use it only for minification.

[UglifyJS does a good job of this](https://github.com/mishoo/UglifyJS2/blob/master/lib/sourcemap.js). I've taken the ideas from their code
to see if I could make LESS's minifier (albeit only compression(?)) also accept
an input source map. I haven't tested this code because I'm currently having
trouble getting LESS setup for development of my machine, but it would be good
to throw this out there nonetheless.