ember-cli / broccoli-asset-rev

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

[Question] How can I use fingerprint for svg file inside my addon? #124

Closed kaermorchen closed 3 years ago

kaermorchen commented 6 years ago

Hello. I am sorry for my English.

I create addon for store svg icons in one file. Template of icon component generate this code:

<svg viewBox="0 0 24 24" width="24" height="24" role="img" class="mdi-icon ember-view">
   <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/assets/icons.svg#bug"></use>
</svg>

But fingerprint don't work with /assets/icons.svg. You can see it on the demo.

I read about options and using but it for EmberApp.

How can I turn on fingerprint for svg file by default inside addon?

st-h commented 3 years ago

@kaermorchen broccoli asset rev does not include svg files in its default file pattern. You'll need to add something like this to ember-cli-build.js:

fingerprint: {
  extensions: ['js', 'css', 'png', 'jpg', 'gif', 'map', 'svg']
},
kaermorchen commented 3 years ago

Thank you