mirror of
https://github.com/swc-project/swc.git
synced 2024-12-29 16:42:28 +03:00
fix(es/codegen): Exclude synthesized files from sourcemap (#4714)
This commit is contained in:
parent
38abde1b44
commit
03dd9de1c3
@ -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(
|
||||
|
@ -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)]
|
||||
|
Loading…
Reference in New Issue
Block a user