Commit ae545b4e authored by Luke Sandberg's avatar Luke Sandberg

drop an opt out PACK-4578

parent 161a8ba0
...@@ -347,26 +347,17 @@ impl SingleModuleGraph { ...@@ -347,26 +347,17 @@ impl SingleModuleGraph {
#[cfg(debug_assertions)] #[cfg(debug_assertions)]
{ {
use once_cell::sync::Lazy; let mut duplicates = Vec::new();
static CHECK_FOR_DUPLICATE_MODULES: Lazy<bool> = Lazy::new(|| { let mut set = FxHashSet::default();
match std::env::var_os("TURBOPACK_TEMP_DISABLE_DUPLICATE_MODULES_CHECK") { for &module in modules.keys() {
Some(v) => v != "1" && v != "true", let ident = module.ident().to_string().await?;
None => true, if !set.insert(ident.clone()) {
} duplicates.push(ident)
});
if *CHECK_FOR_DUPLICATE_MODULES {
let mut duplicates = Vec::new();
let mut set = FxHashSet::default();
for &module in modules.keys() {
let ident = module.ident().to_string().await?;
if !set.insert(ident.clone()) {
duplicates.push(ident)
}
}
if !duplicates.is_empty() {
panic!("Duplicate module idents in graph: {duplicates:#?}");
} }
} }
if !duplicates.is_empty() {
panic!("Duplicate module idents in graph: {duplicates:#?}");
}
} }
let graph = SingleModuleGraph { let graph = SingleModuleGraph {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment