Skip to content

Commit e449fb8

Browse files
authored
Merge pull request #23 from merceyz/merceyz/dollar-signs
fix: handle paths with dollar signs
2 parents f994718 + 1367d12 commit e449fb8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/make-hot.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,9 @@ const createMakeHot = ({ walk, meta = 'import.meta', hotApi, adapter }) => {
429429
acceptable: isAcceptable(hotOptions, compileOptions, compiled),
430430
})
431431

432-
return compiledCode.replace(/(\n?export default ([^;]*);)/, replacement)
432+
return compiledCode.replace(/(\n?export default ([^;]*);)/, (match, $1, $2) => {
433+
return replacement.replace(/\$2/g, () => $2)
434+
})
433435
}
434436

435437
// rollup-plugin-svelte-hot needs hotApi path (for tests)

0 commit comments

Comments
 (0)