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

Fingerprint extensions mixed up for woff and woff2 #28

Closed mislam closed 9 years ago

mislam commented 9 years ago

I was trying to include md5 checksums for fonts files. It works except the checksum of woff is being used for woff2 (which is wrong).

var app = new EmberApp({
  fingerprint: {
    enabled: true,
    extensions: ['js', 'css', 'png', 'jpg', 'gif', 'ico', 'eot', 'svg', 'ttf', 'woff2', 'woff']
  }
});

Reference: https://github.com/stefanpenner/ember-cli/issues/2594#issuecomment-64985430

rickharrison commented 9 years ago

Can you provide a sample of the source that is failing? (Even better would be a failing test case :smile: )

mislam commented 9 years ago

I have provided the source (Brocfile from my ember-cli app).

Here's the css that is importing the font files:

@font-face {
  font-family: 'RobotoRegular';
  src: url('/assets/fonts/roboto-regular.eot');
  src: url('/assets/fonts/roboto-regular.eot?#iefix') format('embedded-opentype'),
    url('/assets/fonts/roboto-regular.woff2') format('woff2'),
    url('/assets/fonts/roboto-regular.woff') format('woff'),
    url('/assets/fonts/roboto-regular.ttf') format('truetype'),
    url('/assets/fonts/roboto-regular.svg#robotoregular') format('svg');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'Flaticon';
  src: url('/assets/fonts/flaticon.eot');
  src: url("/assets/fonts/flaticon.eot#iefix") format("embedded-opentype"),
    url("/assets/fonts/flaticon.woff") format("woff"),
    url("/assets/fonts/flaticon.ttf") format("truetype"),
    url("/assets/fonts/flaticon.svg") format("svg");
  font-weight: normal;
  font-style: normal;
}

This screenshot should help to understand the situation:

rickharrison commented 9 years ago

I have a failing test case for this issue. I still need to brainstorm about the best way to fix this issue.

rickharrison commented 9 years ago

This should be fixed in 1.1.1 - Please let me know if this does not fix your issue and I will re-open.

mislam commented 9 years ago

The issue is fixed now with v1.1.1. Thanks a bunch!