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

Dynamic URLs in JS don't get rewritten (rootURL case) #134

Open mehulkar opened 4 years ago

mehulkar commented 4 years ago
class Foo {
  imagePath = `${imageDir}/sample.png`;
}

This doesn't get rewritten with the asset rev. One use case for this is in an Ember app that specifies a rootURL. Because a JS declaration to a path doesn't handle rootURLs, we have to prefix them with ${ENV.rootURL}/assets/images/sample.png.

nruth commented 3 years ago

https://github.com/adopted-ember-addons/ember-cli-ifa might help. It was mentioned in #141 In our app I just use what you mentioned, except ${ENV.rootURL}assets without the / before assets, so you don't get two /s.