Skip to content

Commit

Permalink
fix(prebundleSvelteLibraries): don't try to append non-existing sourc…
Browse files Browse the repository at this point in the history
…emap (#737)

* fix(prebundleSvelteLibraries): don't try to append non-existing sourcemap

* chore: add changeset
  • Loading branch information
dominikg authored Sep 15, 2023
1 parent be5bd3c commit 066482a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/smart-ears-invent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/vite-plugin-svelte': patch
---

fix(prebundleSvelteLibraries): don't try to append missing sourcemap
4 changes: 3 additions & 1 deletion packages/vite-plugin-svelte/src/utils/esbuild.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,5 +106,7 @@ async function compileSvelte(options, { filename, code }, statsCollection) {
if (endStat) {
endStat();
}
return compiled.js.code + '//# sourceMappingURL=' + compiled.js.map.toUrl();
return compiled.js.map
? compiled.js.code + '//# sourceMappingURL=' + compiled.js.map.toUrl()
: compiled.js.code;
}

0 comments on commit 066482a

Please sign in to comment.