Skip to content

Commit be06d6e

Browse files
committed
fix: use appinfo.customLoader
1 parent 4d8fee9 commit be06d6e

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

dev/main/src/config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ let defaultConfig: interfaces.Options = {
4040
beforeMount(appInfo) {
4141
console.log('beforeMount', appInfo);
4242
},
43+
44+
customLoader() {},
4345
};
4446

4547
setTimeout(() => {

packages/runtime/core/src/garfish.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ export class Garfish extends EventEmitter {
215215
manager,
216216
resources,
217217
isHtmlMode,
218-
this.options.customLoader,
218+
appInfo.customLoader,
219219
);
220220

221221
// The registration hook will automatically remove the duplication

packages/runtime/core/src/interface.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,13 @@ export namespace interfaces {
7878
customLoader?: CustomerLoader;
7979
}
8080

81-
export type AppLifecycle = Pick<GlobalLifecycle, keyof AppHooks['lifecycle']>;
81+
export type AppLifecycle = Pick<
82+
GlobalLifecycle,
83+
keyof AppHooks['lifecycle']
84+
> & {
85+
/** @deprecated */
86+
customLoader?: CustomerLoader;
87+
};
8288

8389
export type AppConfig = Pick<
8490
Config,
@@ -90,13 +96,14 @@ export namespace interfaces {
9096
| 'insulationVariable'
9197
> & {
9298
name: string;
93-
entry: string;
99+
entry?: string;
94100
cache?: boolean;
95101
nested?: number;
96102
noCheckProvider?: boolean;
97103
};
98104

99105
export interface Options extends Config, GlobalLifecycle {}
106+
100107
export interface AppInfo extends AppConfig, AppLifecycle {}
101108

102109
export interface Plugin extends Partial<PluginLifecycle> {

0 commit comments

Comments
 (0)