ember-cli / broccoli-asset-rewrite

Broccoli plugin to rewrite a source tree from an asset map.
MIT License
10 stars 53 forks source link

Using template literals in assets path are not replaced with the finger printed checksum. #66

Open sarathkumarbaskaran opened 6 years ago

sarathkumarbaskaran commented 6 years ago

Using string literals in asset path is not replacing the finger printed value because string literal expressions are not captured in the regex.

Example -

   `${this.get('assetPath')}/images/asset.png`  // this has no effect
   this.get('assetPath') + '/images/asset.png'  // this works
dnahodil commented 5 years ago

I am getting this too, (I've worked around it the same way that you have).

I was wondering if it's because this library is only intended for HTML/CSS/HBS and not JS? e.g. This comment doesn't mention JS files: https://github.com/rickharrison/broccoli-asset-rewrite/blob/8cb5062189939d03b1f238eb95e61e7dbd45e9fe/index.js#L94

@rickharrison Is this library intended to replace paths in JS files, too?

Also, is this library actively taking changes at the moment? (I've seen some other comments about trying to have maintenance moved to the Ember team). If so I might try to put up a PR for the change + tests. (Time permitting)

rickharrison commented 5 years ago

Yes, it was intended to replace most paths in js files as well.

Most of the ember team already had commit/publish access to the repos. Let me know if I need to add anyone else!

dnahodil commented 5 years ago

Thanks for the quick response, Rick!

Okay, thanks. Well I'll have a dig in and see what I can come up with.

Cheers,

patocallaghan commented 3 years ago

I got hit by this today trying to drop support for IE11 😅 I just stumbled upon this open issue after opening a similar one over at broccoli-asset-rev.

@rwjblue @dnahodil is there any chance we could get the PR in https://github.com/ember-cli/broccoli-asset-rewrite/pull/73 merged?