| 361 | }, [pendingTasks, executeList]) |
| 362 | |
| 363 | const getModule = (routerPrefix: string, specific = false) => { |
| 364 | if (routerPrefix.startsWith('/')) { |
| 365 | routerPrefix = routerPrefix.substring(1) |
| 366 | } |
| 367 | if (specific) { |
| 368 | return modules.get(routerPrefix) |
| 369 | } |
| 370 | let matchedModule = null |
| 371 | let matchedLength = 0 |
| 372 | |
| 373 | modules.forEach((value, key) => { |
| 374 | if (routerPrefix.startsWith(key) && key.length > matchedLength) { |
| 375 | matchedModule = value |
| 376 | matchedLength = key.length |
| 377 | } |
| 378 | }) |
| 379 | return matchedModule |
| 380 | } |
| 381 | |
| 382 | const loadModule = async (routerPrefix: string, pluginName: any, exposedModule: string, pluginPath: any) => { |
| 383 | if (!modules.get(routerPrefix)) { |