Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for rewriting multiple references to the same asset #62

Closed
wants to merge 4 commits into from
Closed

Add support for rewriting multiple references to the same asset #62

wants to merge 4 commits into from

Conversation

epetrsn
Copy link

@epetrsn epetrsn commented Nov 1, 2017

Fixes #39 and #59.

Previously, when a matching asset path was found, the matched path was replaced globally with replaceString. When a file contains multiple references to the same (or similar) asset paths, the matching part of the path may be replaced globally multiple times. In the case where there is a prepend string and no fingerprint, the resulting path may contain duplicate segments.

This PR uses String.prototype.replace to allow for local replacements of each matched asset path. This approach removes the possibility that a path could be replaced multiple times. It also ensures that each matched path is replaced with the correct replaceString.

Additionally, new tests have been added for duplicate assets paths and escaped quotation marks (e.g., compiled Glimmer templates)

@rwjblue
Copy link
Member

rwjblue commented Nov 5, 2017

This seems like a nice fix (and I love seeing more test cases!), thank you for putting it together.

I'll leave this open for a short while to allow others to review, but please ping me if I don't get back to it in a couple days...

@epetrsn
Copy link
Author

epetrsn commented Nov 13, 2017

@rwjblue Any update on the status of this PR?

@TRMW
Copy link

TRMW commented Mar 6, 2018

@rwjblue (and anyone else with approve privileges) I'd love to see this get merged!

@apellerano-pw
Copy link

@rwjblue any word on when this can get added in?

@epetrsn
Copy link
Author

epetrsn commented Aug 3, 2018

@rwjblue Pinging again. Any objection to merging this?

@epetrsn epetrsn closed this Sep 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

doesn't handle multiple references to the same URL
4 participants