added optional feature for rewriting CSS images to output-fol...
...der on package compression.
Experimental! See also https://github.com/yiisoft/yii/issues/1033 - how do you work around the images problem?
I found a much better solution, IMHO. Please let me know what you think.
tl;dr Basically don't copy anything, but (optionally) rewrite CSS file URLs relative to your webroot.
PackageCompressor ~line 149
foreach(array_keys($this->cssFiles) as $file) {
$f = $basePath.$file;
if ($this->rewriteCssUris) {
file_put_contents($f, Minify_CSS_UriRewriter::rewrite(file_get_contents($f), dirname($f), $basePath));
}
$files[] = $f;
}
This would replace the previous PR.
Background:
I ran into issue with YiiBooster, which contains relative URLs with ../fonts. The current proposal is unable to catch these cases and moreover the files are all already available in a public location.
So I seemed the most natural solution to me to reuse these files in the final CSS.
Works fine so far from a virtual host, I had an issue with running it from a sub-path, but that should be fixable.
PS: This would also add one composer dependency.
[edit]
sample output:
url(/assets/7dd6006e/img/ui-bg_glass_75_ffffff_1x400.png)