Closed clydin closed 7 years ago
@ai Who is current maintainer here ? 😛 This is likely needed for postcss-loader
in the future in one way or the other (didn't check the PR yet), since css-loader
will drop url()
resolving in v1.0.0
aswell as it seems atm. This change is 👍 in general, I can 'help' with it if needed :)
Supporting postcss-loader
and allowing it to handle url()
's instead of css-loader
is indeed the primary goal of this PR.
@clydin Did you try your branch of postcss-url
+ postcss-loader
?. Any insights upon this are highly welcome 😛 , but I guess it will require more to get it working (postcss-loader
Interface)
I think @MoOx is maintainer. And he will be happy if somebody will take maintainer role.
@michael-ciniawsky @ai i already take it
@michael-ciniawsky @clydin i didn't check PR, but i understand the problem. I will check it soon
@sergcen 👍 No rush at all, I just started to investigate for postcss-loader
into the url()
related parts and was delighted to see the main 'plugin part' already done here 💯 😛
Since postcss-loader already handles the dependency message, both inline and copy work. Note that the copy action handles the actual copying to output so file-loader/URL-loader are not needed/used. Something to consider is whether an additional message and/or postcss-URL action would be useful to allow postcss-loader to inject the file as an asset. Definitely a subject for a separate PR though.
Something to consider is whether an additional message and/or postcss-URL action would be useful to allow postcss-loader to inject the file as an asset.
That's an interesting idea 😛 I will make a note 🙃
Since postcss-loader already handles the dependency message, both inline and copy work. Note that the copy action handles the actual copying to output so file-loader/URL-loader are not needed/used.
Yeah, when these two 'suckers' are envolved, it gets fairly tricky to resolve url()
's, since they need a 'special' placeholder ___PostCSS__LOADER__URL__(${index})
to work and url(./path/to/file.png)
needs to be 'requestified' => url(require(___PostCSS__LOADER__URL__${index}))
, but I will open an issue about this in postcss-loader
soon, so let's not spam the PR here further 😛
This adds support for postcss's dependency messaging and allows postcss runners that support file watching to account for any inlined or copied files.