(module: Module)
| 1153 | } |
| 1154 | |
| 1155 | private getPreserveModulesChunkNameFromModule(module: Module): string { |
| 1156 | const predefinedChunkName = getPredefinedChunkNameFromModule(module); |
| 1157 | if (predefinedChunkName) return predefinedChunkName; |
| 1158 | const { preserveModulesRoot, sanitizeFileName } = this.outputOptions; |
| 1159 | const sanitizedId = sanitizeFileName(normalize(module.id.split(QUERY_HASH_REGEX, 1)[0])); |
| 1160 | const extensionName = extname(sanitizedId); |
| 1161 | const idWithoutExtension = NON_ASSET_EXTENSIONS.has(extensionName) |
| 1162 | ? sanitizedId.slice(0, -extensionName.length) |
| 1163 | : sanitizedId; |
| 1164 | if (isAbsolute(idWithoutExtension)) { |
| 1165 | if (preserveModulesRoot && resolve(idWithoutExtension).startsWith(preserveModulesRoot)) { |
| 1166 | return idWithoutExtension.slice(preserveModulesRoot.length).replace(/^[/\\]/, ''); |
| 1167 | } else { |
| 1168 | // handle edge case in Windows |
| 1169 | if (this.inputBase === '/' && idWithoutExtension[0] !== '/') { |
| 1170 | return relative(this.inputBase, idWithoutExtension.replace(/^[a-zA-Z]:[/\\]/, '/')); |
| 1171 | } |
| 1172 | return relative(this.inputBase, idWithoutExtension); |
| 1173 | } |
| 1174 | } else { |
| 1175 | return ( |
| 1176 | this.outputOptions.virtualDirname.replace(/\/$/, '') + '/' + basename(idWithoutExtension) |
| 1177 | ); |
| 1178 | } |
| 1179 | } |
| 1180 | |
| 1181 | private getReexportSpecifiers(): Map<Chunk | ExternalChunk, ReexportSpecifier[]> { |
| 1182 | const { externalLiveBindings, interop } = this.outputOptions; |
no test coverage detected