Skip to content

Commit 41e7955

Browse files
authored
feat: make eval-ed compiler debuggable (#522)
* feat: make eval-ed compiler debuggable * changeset
1 parent 3d3ebe4 commit 41e7955

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

.changeset/lazy-kids-brush.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sveltejs/repl': patch
3+
---
4+
5+
feat: make eval-ed compiler debuggable

packages/repl/src/lib/workers/bundler/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ self.addEventListener(
4242
// unpkg doesn't set the correct MIME type for .cjs files
4343
// https://github.com/mjackson/unpkg/issues/355
4444
const compiler = await fetch(`${svelte_url}/compiler.cjs`).then((r) => r.text());
45-
(0, eval)(compiler);
45+
(0, eval)(compiler + '\n//# sourceURL=compiler.cjs@' + version);
4646
} else {
4747
try {
4848
importScripts(`${svelte_url}/compiler.js`);

packages/repl/src/lib/workers/compiler/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ self.addEventListener(
2424
// unpkg doesn't set the correct MIME type for .cjs files
2525
// https://github.com/mjackson/unpkg/issues/355
2626
const compiler = await fetch(`${svelte_url}/compiler.cjs`).then((r) => r.text());
27-
(0, eval)(compiler);
27+
(0, eval)(compiler + '\n//# sourceURL=compiler.cjs@' + version);
2828
} else {
2929
try {
3030
importScripts(`${svelte_url}/compiler.js`);

0 commit comments

Comments
 (0)