diff --git a/crates/swc/src/lib.rs b/crates/swc/src/lib.rs index cf07fd794d0..2dcebad9557 100644 --- a/crates/swc/src/lib.rs +++ b/crates/swc/src/lib.rs @@ -604,6 +604,14 @@ impl SourceMapGenConfig for SwcSourceMapConfig<'_> { fn emit_columns(&self, _f: &FileName) -> bool { self.emit_columns } + + fn skip(&self, f: &FileName) -> bool { + if let FileName::Custom(s) = f { + s.starts_with('<') + } else { + false + } + } } pub(crate) fn minify_file_comments( diff --git a/crates/swc_common/src/source_map.rs b/crates/swc_common/src/source_map.rs index 8aeab869525..812af2c8717 100644 --- a/crates/swc_common/src/source_map.rs +++ b/crates/swc_common/src/source_map.rs @@ -1205,6 +1205,9 @@ impl SourceMap { &f } }; + if config.skip(&f.name) { + continue; + } let emit_columns = config.emit_columns(&f.name); @@ -1342,6 +1345,10 @@ pub trait SourceMapGenConfig { fn emit_columns(&self, _f: &FileName) -> bool { true } + + fn skip(&self, _f: &FileName) -> bool { + false + } } #[derive(Debug, Clone)]