duojs / file-deps

Find and replace all the dependencies in a JS or CSS file.
7 stars 2 forks source link

Does not recognize multiple background-images properly #13

Open dominicbarnes opened 9 years ago

dominicbarnes commented 9 years ago

When using multiple backgrounds, this module does not parse url() declarations after the first one properly:

a {
  background-image: url('./logo.png'), url('./caret.png');
}

The first one (./logo.png) gets parsed correctly, but the 2nd (./caret.png) is not detected. (and is not rewritten by the consumer)

matthewmueller commented 9 years ago

yikes, maybe we should just move towards using postcss or css-parse :-/

this could probably be fixed up, but I wonder if it's worth it if these issues keep coming up.

dominicbarnes commented 9 years ago

Yeah, I totally see that being a valuable way to offload this effort. fwiw, I've also considered adopting rework to handle CSS in duo-pack, because generating source-maps and stuff by hand is proving extremely difficult once things start operating recursively. :(

matthewmueller commented 9 years ago

yah i'm +1 to this change. originally it was to speed up the parsing, but i didn't realize the complexity and developer cost plain regexps would bring.

dominicbarnes commented 9 years ago

Cool, would you mind moving this to the duojs organization?

matthewmueller commented 9 years ago

done, added you on npm as well