Skip to content

Commit 522cb92

Browse files
committed
fix: adjust the call of cunstomLoader
1 parent 6bccf78 commit 522cb92

File tree

1 file changed

+9
-11
lines changed
  • packages/runtime/core/src/module

1 file changed

+9
-11
lines changed

packages/runtime/core/src/module/app.ts

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -550,17 +550,15 @@ export class App {
550550
}
551551

552552
// If you have customLoader, the dojo.provide by user
553-
if (this.customLoader) {
554-
const customLoader = await this.customLoader;
555-
const hookRes = customLoader?.(provider, appInfo, basename);
556-
if (hookRes) {
557-
const { mount, unmount } = hookRes || ({} as any);
558-
if (typeof mount === 'function' && typeof unmount === 'function') {
559-
mount._custom = true;
560-
unmount._custom = true;
561-
provider.render = mount;
562-
provider.destroy = unmount;
563-
}
553+
const customLoader = await this.customLoader;
554+
const hookRes = customLoader?.(provider, appInfo, basename);
555+
if (hookRes) {
556+
const { mount, unmount } = hookRes || ({} as any);
557+
if (typeof mount === 'function' && typeof unmount === 'function') {
558+
mount._custom = true;
559+
unmount._custom = true;
560+
provider.render = mount;
561+
provider.destroy = unmount;
564562
}
565563
}
566564

0 commit comments

Comments
 (0)