fix: ensure source and filename are known to compileModule's source map (#13546)

Similar to a change that was part of #10459

Fixes https://github.com/sveltejs/svelte-loader/issues/238
pull/13549/head
Simon H 11 months ago committed by GitHub
parent 0d3d5a2a85
commit 6776947ae8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: ensure source and filename are known to compileModule's source map

@ -35,6 +35,7 @@ export function transform_component(analysis, source, options) {
const js_source_name = get_source_name(options.filename, options.outputFilename, 'input.svelte');
const js = print(program, {
// include source content; makes it easier/more robust looking up the source map code
// (else esrap does return null for source and sourceMapContent which may trip up tooling)
sourceMapContent: source,
sourceMapSource: js_source_name
});
@ -91,7 +92,12 @@ export function transform_module(analysis, source, options) {
}
return {
js: print(program, {}),
js: print(program, {
// include source content; makes it easier/more robust looking up the source map code
// (else esrap does return null for source and sourceMapContent which may trip up tooling)
sourceMapContent: source,
sourceMapSource: get_source_name(options.filename, undefined, 'input.svelte.js')
}),
css: null,
metadata: {
runes: true

Loading…
Cancel
Save