Skip to content

Commit 8342649

Browse files
committed
fix: fix invoke loadController repeatedly
1 parent 4e6effd commit 8342649

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/midway-web/src/loader/webLoader.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ export class MidwayWebLoader extends MidwayLoader {
2424
router: Router
2525
}> = [];
2626

27-
async loadController(opt?): Promise<void> {
27+
async loadController(opt: { directory? } = {}): Promise<void> {
2828
// load midway controller to binding router
2929
const appDir = path.join(this.options.baseDir, 'app');
3030
const results = loading(this.getFileExtension(['controllers/**/*', 'controller/**/*']), {
31-
loadDirs: appDir,
31+
loadDirs: opt.directory || appDir,
3232
call: false,
3333
});
3434

0 commit comments

Comments
 (0)