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

Preprend doesn't work with @font-face #42

Closed cibernox closed 9 years ago

cibernox commented 9 years ago

I can't get the prepend options to work with urls inside @font-face.

Example in ember-cli:

// In app.scss (I'm using sass)
@font-face {
  font-family: 'Open Sans';
  font-weight: 400;
  font-style: normal;
  src: url('/fonts/OpenSans.eot');
  src: url('/fonts/OpenSans.eot?#iefix') format('embedded-opentype'),
       local('Open Sans'),
       local('OpenSans'),
       url('/fonts/OpenSans.woff') format('woff'),
       url('/fonts/OpenSans.ttf') format('truetype'),
       url('/fonts/OpenSans.svg#OpenSans') format('svg');
}
// Brocfile
var EmberApp = require('ember-cli/lib/broccoli/ember-app');

var app = new EmberApp({
  fingerprint: {
    prepend: 'https://s3-eu-west-1.amazonaws.com/my-bucket/'
  }
});

module.exports = app.toTree();

The generated output is exactly the same as in the .scss file.

rickharrison commented 9 years ago

Try using a css format like this and let me know if that fixes it:

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

No difference.

This particular case I don't care about asset fingerprinting itself, but about the cdn prepend funcionality. My fonts are not going to change, but I want them to live in the same CDN.

rickharrison commented 9 years ago

Could you write a test to reproduce this as failing?

cibernox commented 9 years ago

I'll try later today On Mar 26, 2015 6:43 PM, "Rick Harrison" notifications@github.com wrote:

Could you write a test to reproduce this as failing?

— Reply to this email directly or view it on GitHub https://github.com/rickharrison/broccoli-asset-rev/issues/42#issuecomment-86663493 .