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: handle path with dollar signs #149

Merged
merged 1 commit into from
Jan 13, 2021

Conversation

merceyz
Copy link
Contributor

@merceyz merceyz commented Jan 12, 2021

What's the problem this PR addresses?

If the filepath contains two dollar signs ($$) then the replacement here

return code.replace(/(export default ([^;]*));/, replacement);
removes one of them causing webpack to look for a path that doesn't exist

.yarn/$$virtual/svelte-loader-virtual-ffb4749d44/2/svelte-loader/lib/hot-api.js turns into .yarn/$virtual/svelte-loader-virtual-ffb4749d44/2/svelte-loader/lib/hot-api.js

How did you fix it?

Use the callback version of replace which uses the literal value provided

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