accord icon indicating copy to clipboard operation
accord copied to clipboard

Multi Stage Sourcemap Support

Open jescalan opened this issue 9 years ago • 5 comments

In addition to simply accepting input text, each adapter should also accept an object containing input text and a sourcemap, and if the adapter produces a sourcemap of its own, merge it with the incoming sourcemap. Not a super complicated change, nor is it breaking, just want to have it noted here as this will be an important feature down the line.

jescalan avatar Jun 09 '15 16:06 jescalan

So is this why sourcemaps wouldn't work if I'm using both postcss and stylus as multi compile?

dbox avatar Jul 07 '15 18:07 dbox

Yes. Won't be a huge feature to add though, just need some time or someone to contribute!

On Tue, Jul 7, 2015, 8:51 PM Daniel Box [email protected] wrote:

So is this why sourcemaps wouldn't work if I'm using both postcss and stylus as multi compile?

— Reply to this email directly or view it on GitHub https://github.com/jenius/accord/issues/103#issuecomment-119301914.

jescalan avatar Jul 08 '15 08:07 jescalan

maybe @hhsnopek ? :angel: :pray:

dbox avatar Jul 10 '15 01:07 dbox

Could you define merge @jenius? For instance if we have multipass on .css.styl, which will start with stylus, then move to postcss, will it only contain the original stylus code then append the postcss code?

hhsnopek avatar Jul 10 '15 02:07 hhsnopek

Basically input should take either a string or an object, then if its an object and has a sourcemap key/val pair, it should run a sourcemap merge as such: https://github.com/jenius/autoprefixer-stylus/blob/master/index.js#L45

jescalan avatar Jul 10 '15 19:07 jescalan