Skip to content

Commit 6f1222f

Browse files
authored
fix: compat htmlPartials hooks result error (#6644)
1 parent e5b16df commit 6f1222f

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

.changeset/dirty-spies-cough.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
'app-document': patch
3+
'@modern-js/app-tools': patch
4+
---
5+
6+
fix: compat htmlPartials hooks result error
7+
8+
fix: 修复兼容 htmlPartials 钩子函数时返回值错误

packages/solutions/app-tools/src/compat/utils.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { getModifyHtmlPartials } from '../plugins/analyze/getHtmlTemplate';
2+
13
/**
24
* Maps old plugin hook function names to new plugin API names
35
*/
@@ -91,6 +93,11 @@ export function transformHookResult(hookRunnerName: string, result: any) {
9193
switch (hookRunnerName) {
9294
case 'resolvedConfig':
9395
return result.resolved;
96+
case 'htmlPartials':
97+
return {
98+
partials: getModifyHtmlPartials(result.partials),
99+
entrypoint: result.entrypoint,
100+
};
94101
default:
95102
return result;
96103
}

0 commit comments

Comments
 (0)