gabrielflorit / gulp-smoosher

Inline css and js links with file contents
MIT License
35 stars 6 forks source link

path resolving #17

Closed TxHawks closed 9 years ago

TxHawks commented 9 years ago

It would be useful to have a way to transform paths, so that, for instance, if my css file was in the styles directory, and had a rule of background-image: url(../images/some-image.png) it could be transformed into background-image: url(images/some-image.png) (sans the ../) in the inlined css.

Or does this already exist and I'm missing something?

gabrielflorit commented 9 years ago

It doesn't exist, no. Perhaps you could modify the css before it is handed over to smoosher?

TxHawks commented 9 years ago

For future reference, I ended up solving using with gulp-replace: .pipe($.replace('url("../', 'url("'))

Thanks

gabrielflorit commented 9 years ago

Nice.