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 replacing in backticks strings in JS #73

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dnahodil
Copy link

This PR adds support for rewriting asset paths in Javascript template literals (a.k.a backtick strings). This includes some† support for string interpolation. It is intended to address the issue reported here: #66

† I've added support for what seemed like the most common cases of string interpolation: variables and property access, method calls, method calls with strings, array index access. As far as I know any valid JS expressions could go in a string interpolation, so that could include arrow functions and other complicated structures. The updated regex section accepts any characters except the closing brace } so potentially it might not match on a line with a complicated string interpolation.

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.

1 participant