* Returns list of exports referenced by this dependency * @param {ModuleGraph} moduleGraph module graph * @param {RuntimeSpec} runtime the runtime for which the module is analysed * @returns {ReferencedExports} referenced exports
(moduleGraph, runtime)
| 95 | * @returns {ReferencedExports} referenced exports |
| 96 | */ |
| 97 | getReferencedExports(moduleGraph, runtime) { |
| 98 | if (!this.referencedExports) return Dependency.EXPORTS_OBJECT_REFERENCED; |
| 99 | /** @type {ReferencedExports} */ |
| 100 | const refs = []; |
| 101 | for (const referencedExport of this.referencedExports) { |
| 102 | if (referencedExport[0] === "default") { |
| 103 | const selfModule = |
| 104 | /** @type {Module} */ |
| 105 | (moduleGraph.getParentModule(this)); |
| 106 | const importedModule = |
| 107 | /** @type {Module} */ |
| 108 | (moduleGraph.getModule(this)); |
| 109 | const exportsType = importedModule.getExportsType( |
| 110 | moduleGraph, |
| 111 | /** @type {BuildMeta} */ |
| 112 | (selfModule.buildMeta).strictHarmonyModule |
| 113 | ); |
| 114 | if ( |
| 115 | exportsType === "default-only" || |
| 116 | exportsType === "default-with-named" |
| 117 | ) { |
| 118 | return Dependency.EXPORTS_OBJECT_REFERENCED; |
| 119 | } |
| 120 | } |
| 121 | refs.push({ |
| 122 | name: referencedExport, |
| 123 | canMangle: false, |
| 124 | canInline: false |
| 125 | }); |
| 126 | } |
| 127 | return refs; |
| 128 | } |
| 129 | |
| 130 | /** |
| 131 | * Serializes this instance into the provided serializer context. |
nothing calls this directly
no test coverage detected