borodean / postcss-assets

An asset manager for PostCSS
MIT License
537 stars 32 forks source link

relative assumes input file path === output file path #50

Closed kilianc closed 8 years ago

kilianc commented 8 years ago

when using this in an asset pipeline it often happens that you bundle everything in your css folder into bundle.min.css and in my case the output file is in the root.

assuming I have css/main.css it resolves correctly images/foo.png into ../images/foo.png but this breaks the output bundle.

I would suggest to allow a string to be passed to relative representing the path you want to resolve against.

borodean commented 8 years ago

@kilianc 4.1.0 is now capable of receiving a string as relative option value. If a string is provided, generated paths would be relative to a path described in it.