Skip to content

Commit 3ece991

Browse files
committed
feat(minifier): remove unused import.meta statement (#8744)
1 parent 3ef980a commit 3ece991

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

crates/oxc_minifier/src/peephole/remove_dead_code.rs

+2
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ impl<'a, 'b> PeepholeOptimizations {
325325
}
326326

327327
match &mut stmt.expression {
328+
Expression::MetaProperty(e) => Some(ctx.ast.statement_empty(e.span)),
328329
Expression::ArrayExpression(expr) => Self::try_fold_array_expression(expr, ctx),
329330
Expression::ObjectExpression(object_expr) => {
330331
Self::try_fold_object_expression(object_expr, ctx)
@@ -874,6 +875,7 @@ mod test {
874875
test("-1", "");
875876
test("!1", "");
876877
test("1", "");
878+
test("import.meta", "");
877879
}
878880

879881
#[test]

0 commit comments

Comments
 (0)