Closed jasonkuhrt closed 10 years ago
This has nothing to do with @ai's autoprefixer.
The issue is css-url-rewriter
(https://github.com/callumlocke/css-url-rewriter/blob/master/lib/css-url-rewriter.js) has regexp that reads url(...)
(http://refiddle.com/refiddles/match-multiple-urls-within-a-css-property-value) which component/builder2.js
(https://github.com/component/builder2.js/blob/master/lib/plugins/url-rewriter.js#L27-L39) treats AS IF IT WERE just the ...
part (from above), see:
[...]
file.string = rewriteCSSURLs(string, function (uri) {
var orig = 'url(' + uri + ')'; // <<<<<<< ERROR url(url(...))
[...]
So the bug is in component/builder2.js
@jonathanong @callumlocke Hey guys at this time, a fix is required in one of or both:
Before diving into a pull-request I would like to vet the direction to take and if you want to fix yourselves.
A fix in component/builder2.js
might look like:
file.string = rewriteCSSURLs(string, function (justURL) {
if (isData(justURL)) return justURL;
if (isAbsolute(justURL)) return justURL;
// IS THERE A BUG HERE TOO?
justURL = resolve(file.path, justURL);
justURL = resolve(prefix + utils.rewriteUrl(branch) + '/', justURL);
return justURL;
});
k pushed to component-builder@1.1.3
Compiles to:
I'm trying to figure out if this bug comes from @ai's autoprefixer or not.