diff --git a/crates/oxc_ecmascript/Cargo.toml b/crates/oxc_ecmascript/Cargo.toml index c3d294e6e..124e4672b 100644 --- a/crates/oxc_ecmascript/Cargo.toml +++ b/crates/oxc_ecmascript/Cargo.toml @@ -27,3 +27,8 @@ oxc_syntax = { workspace = true, features = ["to_js_string"] } num-bigint = { workspace = true } num-traits = { workspace = true } + +[features] +default = [] +side_effects = [] +constant_evaluation = ["side_effects"] diff --git a/crates/oxc_ecmascript/src/lib.rs b/crates/oxc_ecmascript/src/lib.rs index 0a259fe1b..770bc716e 100644 --- a/crates/oxc_ecmascript/src/lib.rs +++ b/crates/oxc_ecmascript/src/lib.rs @@ -18,10 +18,10 @@ mod to_int_32; mod to_number; mod to_string; -// Constant Evaluation +#[cfg(feature = "constant_evaluation")] pub mod constant_evaluation; -// Side Effects +#[cfg(feature = "side_effects")] pub mod side_effects; pub use self::{ diff --git a/crates/oxc_minifier/Cargo.toml b/crates/oxc_minifier/Cargo.toml index e116b932c..06168b3d0 100644 --- a/crates/oxc_minifier/Cargo.toml +++ b/crates/oxc_minifier/Cargo.toml @@ -24,7 +24,7 @@ doctest = false oxc_allocator = { workspace = true } oxc_ast = { workspace = true } oxc_codegen = { workspace = true } -oxc_ecmascript = { workspace = true } +oxc_ecmascript = { workspace = true, features = ["constant_evaluation"] } oxc_mangler = { workspace = true } oxc_parser = { workspace = true } oxc_semantic = { workspace = true }