Skip to content

Commit 13d8cf4

Browse files
committed
add test
1 parent d48daff commit 13d8cf4

File tree

5 files changed

+22
-0
lines changed

5 files changed

+22
-0
lines changed

turbopack/crates/turbopack-core/src/module_graph/merged_modules.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,16 @@ pub async fn compute_merged_modules(module_graph: Vc<ModuleGraph>) -> Result<Vc<
590590
let mut included: FxHashSet<ResolvedVc<Box<dyn Module>>> = FxHashSet::default();
591591

592592
for (original, replacement, replacement_included) in result.into_iter().flatten() {
593+
println!(
594+
"Merged {:?} into {:#?}",
595+
original.ident().to_string().await?,
596+
replacement_included
597+
.iter()
598+
.map(|m| m.ident().to_string())
599+
.try_join()
600+
.await?
601+
);
602+
593603
replacements.insert(original, replacement);
594604
replacements_to_original.insert(ResolvedVc::upcast(replacement), original);
595605
included.extend(replacement_included);
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { foo } from './internal/index.js'
2+
3+
it('should correctly rename imports', () => {
4+
expect(foo({})).toBe(true)
5+
})
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import './patch-other.js'
2+
import { patch as patch2 } from './patch.js'
3+
4+
export const bar = (patch) => patch + 1
5+
export const foo = (patch) => patch !== patch2
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export function patch() {}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export function patch() {}

0 commit comments

Comments
 (0)