reworkcss/css-stringify — pull request #40 by lydell (2014-05-31 21:39:56+00:00)
Title: [WIP] Fix #39: Generate correct source paths

- Allow `options.filename` to be a path to the intended output file (not
just the basename of it).

- Set the `file` property of the source map to the basename of
`options.filename`, or don’t set it at all if `options.filename` was
omitted.

- Allow `options.sourcemap` to be a string: The path to the intended
location of the source map. If relative, it is relative to the current
working directory. (Only the dirname of `options.sourcemap` is used.)

- If `options.sourcemap` is set to `true`, assume that the source map is
intended to either be placed next to `options.filename`, or be inlined
into the CSS as a data uri, by using the dirname of `options.filename`
or the current working directory if `options.filename` was omitted
(instead of using the dirname of `options.sourcemap` as in the above
bullet point).

- Make relative source paths relative to the source map directory before
adding them to the source map.

- Make relative source paths from applied original maps relative to the
source map directory before adding them to the map.

---

TODO: Tests and docs.