@@ -38,6 +38,21 @@ pub struct CompressOptions {
3838
3939 /// Keep function / class names.
4040 pub keep_names : Option < CompressOptionsKeepNames > ,
41+
42+ /// Join consecutive var, let and const statements.
43+ ///
44+ /// @default true
45+ pub join_vars : Option < bool > ,
46+
47+ /// Join consecutive simple statements using the comma operator.
48+ ///
49+ /// `a; b` -> `a, b`
50+ ///
51+ /// @default true
52+ pub sequences : Option < bool > ,
53+
54+ /// Limit the maximum number of iterations for debugging purpose.
55+ pub passes : Option < u8 > ,
4156}
4257
4358impl TryFrom < & CompressOptions > for oxc_minifier:: CompressOptions {
@@ -52,14 +67,13 @@ impl TryFrom<&CompressOptions> for oxc_minifier::CompressOptions {
5267 } ,
5368 drop_console : o. drop_console . unwrap_or ( default. drop_console ) ,
5469 drop_debugger : o. drop_debugger . unwrap_or ( default. drop_debugger ) ,
55- // TODO
56- join_vars : true ,
57- sequences : true ,
70+ join_vars : o. join_vars . unwrap_or ( true ) ,
71+ sequences : o. sequences . unwrap_or ( true ) ,
5872 // TODO
5973 unused : oxc_minifier:: CompressOptionsUnused :: Keep ,
6074 keep_names : o. keep_names . as_ref ( ) . map ( Into :: into) . unwrap_or_default ( ) ,
6175 treeshake : TreeShakeOptions :: default ( ) ,
62- max_iterations : None ,
76+ max_iterations : o . passes ,
6377 } )
6478 }
6579}
0 commit comments