Skip to content

Commit 62ae41a

Browse files
authored
test: fix hot update loader (#11774)
1 parent d1f1565 commit 62ae41a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/rspack-test-tools/src/helper/loaders/hot-update.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,8 @@ export default function (this: any, c: string) {
3737

3838
options.totalUpdates = Math.max(options.totalUpdates, items.length);
3939
options.changedFiles.push(this.resourcePath);
40+
if (options.updateIndex >= items.length) {
41+
return items[items.length - 1];
42+
}
4043
return items[options.updateIndex];
4144
}

0 commit comments

Comments
 (0)