less/less.js — pull request #1543 by andjo (2013-09-11 12:15:25+00:00)
Title: Sourcemap basepath option

I failed to create a correct source map unless standing in exactly right directory when running the lessc command.
I've added a --source-map-basepath option that is used in stead of process.cwd() if supplied, and also normalizing the path printed in the sourceMappingURL.

This is something that works for me right now, but I'm not sure it is the right thing to do. I have not tested it in other configurations. Merge with caution.

I can now invoke the command from my Gruntfile.js like this:

```
shell: {
less: {
command: './node_modules/less/bin/lessc <%= lessSrc %> <%= davMountpoint %><%= templateDir %>/css/prd/main.less.css' +
' --source-map=<%= davMountpoint %><%= templateDir %>/css/prd/main.less.css.map' +
' --source-map-rootpath=/ns/' +
' --source-map-basepath=<%= davMountpoint %>',
options: {
stdout: true,
stderr: true
}
}
},
```