feat(oxc): conditional expose oxc_cfg in oxc crate (#5524)

This is useful when the downside user wants to use `oxc_cfg`, and easy
to reuse `petgraph` in `oxc_cfg`
This commit is contained in:
IWANABETHATGUY 2024-09-06 14:07:43 +08:00 committed by GitHub
parent 1bed5ce2a5
commit ed8ab6d7c8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 9 additions and 0 deletions

1
Cargo.lock generated
View file

@ -1395,6 +1395,7 @@ version = "0.26.0"
dependencies = [
"oxc_allocator",
"oxc_ast",
"oxc_cfg",
"oxc_codegen",
"oxc_diagnostics",
"oxc_index",

View file

@ -40,6 +40,7 @@ oxc_mangler = { workspace = true, optional = true }
oxc_codegen = { workspace = true, optional = true }
oxc_sourcemap = { workspace = true, optional = true }
oxc_isolated_declarations = { workspace = true, optional = true }
oxc_cfg = { workspace = true, optional = true }
[features]
full = ["codegen", "mangler", "minifier", "semantic", "transformer"]
@ -49,6 +50,7 @@ transformer = ["oxc_transformer"]
minifier = ["oxc_mangler", "oxc_minifier"]
codegen = ["oxc_codegen"]
mangler = ["oxc_mangler"]
cfg = ["oxc_cfg"]
serialize = ["oxc_ast/serialize", "oxc_semantic?/serialize", "oxc_span/serialize", "oxc_syntax/serialize"]

View file

@ -84,3 +84,9 @@ pub mod sourcemap {
#[doc(inline)]
pub use oxc_sourcemap::*;
}
#[cfg(feature = "cfg")]
pub mod cfg {
#[doc(inline)]
pub use oxc_cfg::*;
}