postcss / postcss-url

PostCSS plugin to rebase url(), inline or copy asset.
MIT License
377 stars 59 forks source link

Erroneous warning? "Option `to` of postcss is required, ignoring" #57

Closed idolize closed 7 years ago

idolize commented 8 years ago

I'm using the postcss-url "copy" transform over all my CSS files to ensure the images/fonts/etc. of all my dependencies end up in my "dist" as expected. However, some of my CSS paths are actually correct and do not really need rebasing/copying (the relative path stays the same).

However, whenever this situation occurs, I get "Option to of postcss is required, ignoring" warnings because from === to.

Everything works as expected, but I'd like to silence the warnings :disappointed:

(Btw, I am using this plugin via the postcss webpack loader, which does not allow explicit passing of from/to options because they are automatically inferred by the webpack config)

MoOx commented 8 years ago

To be honest, this plugin should not copy and I don't have any clue on your issue. PR is welcome if you find a fix. But since you are using webpack I would recommend to use postcss-url with default value (rebase) and file-loader (css-loader will handle url() as require()). Otherwise take a look to some other postcss copy plugins.

idolize commented 8 years ago

@MoOx Thanks - using file-loader and "rebase" works great for me!

sergcen commented 7 years ago

now you just need pass assetsPath option