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

fix: fully escape string for usage in require call #272

Merged
merged 1 commit into from
May 22, 2021

Conversation

marvin-roesch
Copy link
Contributor

I was trying to use this loader in a project of mine and ran into some issues with certain file names I'm trying to load. Specifically, I have images whose file names contain single quotes '. This package would insert them into the generated require call as-is, leading to a parse error later on.

As the package cannot control the file names it receives, it has to take care of fully escaping the string spliced into the generated module code. I have used the js-string-escape package for this, but the escape function is simple enough that it could also just be included in this package.

@Calvin-LL Calvin-LL merged commit 441e573 into Calvin-LL:main May 22, 2021
@Calvin-LL
Copy link
Owner

Thank you ❤️

@Calvin-LL
Copy link
Owner

I'll publish the update in an hour

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.

2 participants