Skip to content

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