diff --git a/Cargo.lock b/Cargo.lock index ba7c994cda2..8d78a921826 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3405,24 +3405,12 @@ dependencies = [ name = "rspack_plugin_context_replacement" version = "0.1.0" dependencies = [ - "dashmap 5.5.3", "derivative", - "futures", - "glob", - "lazy_static", - "pathdiff", - "regex", "rspack_core", "rspack_error", - "rspack_futures", - "rspack_hash", "rspack_hook", "rspack_paths", "rspack_regex", - "rspack_util", - "rustc-hash 1.1.0", - "sugar_path", - "tokio", "tracing", ] diff --git a/crates/rspack_core/src/context_module.rs b/crates/rspack_core/src/context_module.rs index fbc8b1a7f9a..8d864c310c3 100644 --- a/crates/rspack_core/src/context_module.rs +++ b/crates/rspack_core/src/context_module.rs @@ -1298,7 +1298,7 @@ fn alternative_requests( for item in std::mem::take(&mut items) { items.push(item.clone()); for module in resolve_options.modules() { - let dir = module.replace('\\', "/"); + let dir = module.cow_replace('\\', "/"); if item.request.starts_with(&format!("./{}/", dir)) { items.push(AlternativeRequest::new( item.context.clone(), diff --git a/crates/rspack_plugin_context_replacement/Cargo.toml b/crates/rspack_plugin_context_replacement/Cargo.toml index 7e200aec841..be82d23c981 100644 --- a/crates/rspack_plugin_context_replacement/Cargo.toml +++ b/crates/rspack_plugin_context_replacement/Cargo.toml @@ -5,25 +5,14 @@ license = "MIT" name = "rspack_plugin_context_replacement" repository = "https://github.com/web-infra-dev/rspack" version = "0.1.0" + [dependencies] -dashmap = { workspace = true } derivative = { workspace = true } -futures = { workspace = true } -glob = { workspace = true } -lazy_static = "1.4.0" -pathdiff = { workspace = true, features = ["camino"] } -regex = { workspace = true } rspack_core = { version = "0.1.0", path = "../rspack_core" } rspack_error = { version = "0.1.0", path = "../rspack_error" } -rspack_futures = { version = "0.1.0", path = "../rspack_futures" } -rspack_hash = { version = "0.1.0", path = "../rspack_hash" } rspack_hook = { version = "0.1.0", path = "../rspack_hook" } rspack_paths = { version = "0.1.0", path = "../rspack_paths" } rspack_regex = { version = "0.1.0", path = "../rspack_regex" } -rspack_util = { version = "0.1.0", path = "../rspack_util" } -rustc-hash = { workspace = true } -sugar_path = { workspace = true } -tokio = { workspace = true, features = ["fs"] } tracing = { workspace = true } [package.metadata.cargo-shear]