broccoli-asset-rev icon indicating copy to clipboard operation
broccoli-asset-rev copied to clipboard

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

Open mehulkar opened this issue 5 years ago • 1 comments

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.

mehulkar avatar Mar 18 '20 20:03 mehulkar

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.

nruth avatar Mar 16 '21 17:03 nruth