diff --git a/Cargo.lock b/Cargo.lock index 1a37a99cd6cf..953c2395d7a3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3175,6 +3175,7 @@ dependencies = [ "swc_css_codegen", "swc_css_compat", "swc_css_minifier", + "swc_css_modules", "swc_css_parser", "swc_css_prefixer", "swc_css_utils", diff --git a/crates/swc_core/Cargo.toml b/crates/swc_core/Cargo.toml index 1bf83e9f9b20..47f455f0870b 100644 --- a/crates/swc_core/Cargo.toml +++ b/crates/swc_core/Cargo.toml @@ -148,6 +148,7 @@ css_ast = ["__css", "swc_css_ast"] css_codegen = ["__css", "swc_css_codegen"] css_compat = ["__css", "swc_css_compat"] css_minifier = ["__css", "swc_css_minifier"] +css_modules = ["__css", "swc_css_modules"] css_parser = ["__css", "swc_css_parser"] css_prefixer = ["__css", "swc_css_prefixer"] css_utils = ["__css", "swc_css_utils"] @@ -326,6 +327,7 @@ swc_common = { optional = true, version = "0.29.13", path swc_css_ast = { optional = true, version = "0.124.6", path = "../swc_css_ast" } swc_css_codegen = { optional = true, version = "0.134.18", path = "../swc_css_codegen" } swc_css_minifier = { optional = true, version = "0.99.19", path = "../swc_css_minifier" } +swc_css_modules = { optional = true, version = "0.10.18", path = "../swc_css_modules" } swc_css_parser = { optional = true, version = "0.133.18", path = "../swc_css_parser" } swc_css_prefixer = { optional = true, version = "0.135.18", path = "../swc_css_prefixer" } swc_css_utils = { optional = true, version = "0.121.6", path = "../swc_css_utils/" } diff --git a/crates/swc_core/src/lib.rs b/crates/swc_core/src/lib.rs index ecc089607311..c844f36e5b36 100644 --- a/crates/swc_core/src/lib.rs +++ b/crates/swc_core/src/lib.rs @@ -178,6 +178,12 @@ pub mod css { pub use swc_css_ast::*; } + #[cfg(feature = "css_modules")] + #[cfg_attr(docsrs, doc(cfg(feature = "css_modules")))] + pub mod modules { + pub use swc_css_modules::*; + } + #[cfg(feature = "css_codegen")] #[cfg_attr(docsrs, doc(cfg(feature = "css_codegen")))] pub mod codegen {