Skip to content

Commit

Permalink
feat: 构建加个 onAllBuildComplete 钩子 (#798)
Browse files Browse the repository at this point in the history
  • Loading branch information
0-0Jia authored Jan 20, 2025
1 parent 0cdea25 commit fb52eab
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/commands/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export default (api: IApi) => {
api.service.configManager!.mainConfigFile,
].filter(Boolean) as string[],
});
await api.applyPlugins({ key: 'onAllBuildComplete' });
},
});
};
1 change: 1 addition & 0 deletions src/registerMethods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export default (api: IApi) => {
'addRegularCheckup',
'addSourceCheckup',
'addImportsCheckup',
'onAllBuildComplete',
].forEach((name) => {
api.registerMethod({ name });
});
Expand Down
5 changes: 5 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ export type IApi = PluginAPI &
*/
config: Omit<IFatherConfig, 'extends'>;
userConfig: IFatherConfig;

/**
* lifecycle
*/
onAllBuildComplete: () => void;
};

export enum IFatherBuildTypes {
Expand Down

0 comments on commit fb52eab

Please sign in to comment.