emberfeather/less.js-middleware — pull request #13 by michaelmior (2012-09-07 06:37:23+00:00)
Title: Optionally strip a prefix from the path

Love how easy it is to get up and running with this. Thanks :) Perhaps there's a better solution for my use case, but here's my attempt at solving it. For example, I'd like to have all files under a folder `src/less` compile to a matching tree of css files under `public/css`.

Currently setting `src` and `dst to these paths doesn't work since requesting `css/styles.css` will look in `src/less/css/styles.css` (assuming all files under `public` are served relative to the root.)

I solved this by allowing an optional prefix to be stripped from the beginning of the path name. In the case above, setting `prefix` to `/css/` in the options does the trick. I'm not sure I'm happy with this solution, so I'm open to other ideas :)