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 {
|
fn emit_columns(&self, _f: &FileName) -> bool {
|
||||||
self.emit_columns
|
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(
|
pub(crate) fn minify_file_comments(
|
||||||
|
@ -1205,6 +1205,9 @@ impl SourceMap {
|
|||||||
&f
|
&f
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
if config.skip(&f.name) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
let emit_columns = config.emit_columns(&f.name);
|
let emit_columns = config.emit_columns(&f.name);
|
||||||
|
|
||||||
@ -1342,6 +1345,10 @@ pub trait SourceMapGenConfig {
|
|||||||
fn emit_columns(&self, _f: &FileName) -> bool {
|
fn emit_columns(&self, _f: &FileName) -> bool {
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn skip(&self, _f: &FileName) -> bool {
|
||||||
|
false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
|
Loading…
Reference in New Issue
Block a user