( source: string, importer: string, resolvedId: ResolvedId )
| 475 | } |
| 476 | |
| 477 | private fetchResolvedDependency( |
| 478 | source: string, |
| 479 | importer: string, |
| 480 | resolvedId: ResolvedId |
| 481 | ): Promise<Module | ExternalModule> { |
| 482 | if (resolvedId.external) { |
| 483 | const { attributes, external, id, moduleSideEffects, meta } = resolvedId; |
| 484 | let externalModule = this.modulesById.get(id); |
| 485 | if (!externalModule) { |
| 486 | externalModule = new ExternalModule( |
| 487 | this.options, |
| 488 | id, |
| 489 | moduleSideEffects, |
| 490 | meta, |
| 491 | external !== 'absolute' && isAbsolute(id), |
| 492 | attributes |
| 493 | ); |
| 494 | this.modulesById.set(id, externalModule); |
| 495 | } else if (!(externalModule instanceof ExternalModule)) { |
| 496 | return error(logInternalIdCannotBeExternal(source, importer)); |
| 497 | } else if (doAttributesDiffer(externalModule.info.attributes, attributes)) { |
| 498 | this.options.onLog( |
| 499 | LOGLEVEL_WARN, |
| 500 | logInconsistentImportAttributes( |
| 501 | externalModule.info.attributes, |
| 502 | attributes, |
| 503 | source, |
| 504 | importer |
| 505 | ) |
| 506 | ); |
| 507 | } |
| 508 | return Promise.resolve(externalModule); |
| 509 | } |
| 510 | return this.fetchModule(resolvedId, importer, false, false); |
| 511 | } |
| 512 | |
| 513 | private async fetchStaticDependencies( |
| 514 | module: Module, |
no test coverage detected