Commit 7266264
committed
fix(rolldown_plugin_vite_import_glob): keep common base on path segment boundary (#9070)
Related to vitejs/vite#22170
`get_common_base` used a byte-wise longest common prefix, which could cut in the middle of a path segment — e.g. for `.../pattern3` and `.../pattern4` it returned `.../pattern`, a non-existent directory that made `walkdir` find nothing. Track the last shared separator while walking, and when the walk reaches `max_len` without a byte mismatch, promote `i` itself if both paths are at a segment boundary there. The base now always lands on a component boundary.
I will add a test case on Vite side.1 parent 04c7c23 commit 7266264
1 file changed
Lines changed: 15 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
350 | 350 | | |
351 | 351 | | |
352 | 352 | | |
| 353 | + | |
353 | 354 | | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
354 | 358 | | |
355 | 359 | | |
356 | 360 | | |
357 | | - | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
358 | 372 | | |
359 | 373 | | |
360 | 374 | | |
| |||
0 commit comments