build(bazel): fix bazel built es5 ngfactory with secondary entry-point angular imports (#24170)

PR Close #24170
This commit is contained in:
Greg Magolan 2018-05-29 15:33:12 -07:00 committed by Victor Berchet
parent 08f943a1f3
commit 6948ef125c
1 changed files with 5 additions and 2 deletions

View File

@ -211,7 +211,8 @@ function main(args: string[]): number {
const entryPointName = entryPointPackageName.substr(rootPackageName.length + 1);
if (!entryPointName) return;
createMetadataReexportFile(entryPointName, modulesManifest[entryPointPackageName]['metadata']);
createMetadataReexportFile(
entryPointName, modulesManifest[entryPointPackageName]['metadata'], entryPointPackageName);
createTypingsReexportFile(
entryPointName, licenseBanner, modulesManifest[entryPointPackageName]['typings']);
@ -318,7 +319,8 @@ function main(args: string[]): number {
}
/** Creates metadata re-export file for a secondary entry-point. */
function createMetadataReexportFile(entryPointName: string, metadataFile: string) {
function createMetadataReexportFile(
entryPointName: string, metadataFile: string, packageName: string) {
const inputPath = path.join(srcDir, `${entryPointName}.metadata.json`);
writeFileFromInputPath(inputPath, JSON.stringify({
'__symbolic': 'module',
@ -327,6 +329,7 @@ function main(args: string[]): number {
'exports':
[{'from': `${srcDirRelative(inputPath, metadataFile.replace(/.metadata.json$/, ''))}`}],
'flatModuleIndexRedirect': true,
'importAs': packageName
}) + '\n');
}