ember-cli / broccoli-asset-rev

Broccoli plugin to add fingerprint checksums and CDN URLs to your assets
MIT License
86 stars 83 forks source link

Doesn't update minified HTML #1

Closed rlivsey closed 10 years ago

rlivsey commented 10 years ago

When HTML is minified using broccoli-htmlmin before fingerprinting, it no longer updates the asset paths.

This is because minifying removes the quotes, so

<script src="/assets/app.js"></script>

becomes:

<script src=/assets/app.js></script>

which doesn't match the regex and so is not updated.

rickharrison commented 10 years ago

Thanks for finding that. I can add a = to the first part of the regex and a > to the end. Presumably, though I may need to also check for a in case you have a tag like this:

<script src=/assets/app.js data-attribute=foobar></script>

rlivsey commented 10 years ago

Yeah that should do the trick in most situations I'd have thought, aside from the usual problems of parsing HTML with regex!

rickharrison commented 10 years ago

I might re-factor to only use the regex if you have passed in a prepend path. Otherwise, we can do a straight find and replace. Let me know if you have any other ideas on how to throw a CDN URL in the asset path.

rickharrison commented 10 years ago

Also, please let me know if that fixed your issue. I tested a few different combinations of quotes/no-quotes and it works for me.