Skip to content

Commit

Permalink
add return types, fix return values
Browse files Browse the repository at this point in the history
  • Loading branch information
dnalborczyk committed Jan 23, 2022
1 parent 9140a2e commit b841c99
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/ModuleLoader.ts
Expand Up @@ -549,12 +549,17 @@ export class ModuleLoader {
};
}

private async handleExistingModule(module: Module, isEntry: boolean, isPreload: PreloadType) {
private async handleExistingModule(
module: Module,
isEntry: boolean,
isPreload: PreloadType
): Promise<void> {
const loadPromise = this.moduleLoadPromises.get(module)!;
if (isPreload) {
return isPreload === RESOLVE_DEPENDENCIES
await (isPreload === RESOLVE_DEPENDENCIES
? waitForDependencyResolution(loadPromise)
: loadPromise;
: loadPromise);
return;
}
if (isEntry) {
module.info.isEntry = true;
Expand All @@ -564,7 +569,7 @@ export class ModuleLoader {
}
module.implicitlyLoadedAfter.clear();
}
return this.fetchModuleDependencies(module, ...(await loadPromise));
await this.fetchModuleDependencies(module, ...(await loadPromise));
}

private handleResolveId(
Expand Down Expand Up @@ -715,7 +720,7 @@ function isNotAbsoluteExternal(
);
}

async function waitForDependencyResolution(loadPromise: LoadModulePromise) {
async function waitForDependencyResolution(loadPromise: LoadModulePromise): Promise<void> {
const [resolveStaticDependencyPromises, resolveDynamicImportPromises] = await loadPromise;
return Promise.all([...resolveStaticDependencyPromises, ...resolveDynamicImportPromises]);
await Promise.all([...resolveStaticDependencyPromises, ...resolveDynamicImportPromises]);
}

0 comments on commit b841c99

Please sign in to comment.