[fix] add filename to combined source map if needed (#6089)

pull/6563/head
Simon H 3 years ago committed by GitHub
parent 176c92b9cd
commit 4ca2af41df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -251,6 +251,11 @@ export function combine_sourcemaps(
if (!map.file) delete map.file; // skip optional field `file`
// When source maps are combined and the leading map is empty, sources is not set.
// Add the filename to the empty array in this case.
// Further improvements to remapping may help address this as well https://github.com/ampproject/remapping/issues/116
if (!map.sources.length) map.sources = [filename];
return map;
}

@ -1,5 +1,5 @@
export default {
css_map_sources: [],
css_map_sources: ['input.svelte'],
preprocess: [
{
style: ({ content }) => {

Loading…
Cancel
Save