mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
fix(minifier): the mangle phase should come after the compress phase
To align with terser
This commit is contained in:
parent
a0b9628177
commit
22664a3a83
1 changed files with 3 additions and 3 deletions
|
|
@ -46,12 +46,12 @@ impl<'a> Minifier<'a> {
|
|||
let ret = Parser::new(&allocator, self.source_text, self.source_type).parse();
|
||||
let ret = AstLower::new(&allocator, self.source_type).build(&ret.program);
|
||||
let mut program = ret.program;
|
||||
let mut semantic = ret.semantic;
|
||||
let semantic = ret.semantic;
|
||||
let mut semantic =
|
||||
Compressor::new(&allocator, semantic, self.options.compress).build(&mut program);
|
||||
if self.options.mangle {
|
||||
semantic.mangle();
|
||||
}
|
||||
let semantic =
|
||||
Compressor::new(&allocator, semantic, self.options.compress).build(&mut program);
|
||||
Printer::new(self.source_text.len(), self.options.print)
|
||||
.with_mangle(semantic.symbol_table, self.options.mangle)
|
||||
.build(&program)
|
||||
|
|
|
|||
Loading…
Reference in a new issue