build(bazel): fix bazel built es5 ngfactory with secondary entry-point angular imports (#24170)
PR Close #24170
This commit is contained in:
parent
08f943a1f3
commit
6948ef125c
|
@ -211,7 +211,8 @@ function main(args: string[]): number {
|
||||||
const entryPointName = entryPointPackageName.substr(rootPackageName.length + 1);
|
const entryPointName = entryPointPackageName.substr(rootPackageName.length + 1);
|
||||||
if (!entryPointName) return;
|
if (!entryPointName) return;
|
||||||
|
|
||||||
createMetadataReexportFile(entryPointName, modulesManifest[entryPointPackageName]['metadata']);
|
createMetadataReexportFile(
|
||||||
|
entryPointName, modulesManifest[entryPointPackageName]['metadata'], entryPointPackageName);
|
||||||
createTypingsReexportFile(
|
createTypingsReexportFile(
|
||||||
entryPointName, licenseBanner, modulesManifest[entryPointPackageName]['typings']);
|
entryPointName, licenseBanner, modulesManifest[entryPointPackageName]['typings']);
|
||||||
|
|
||||||
|
@ -318,7 +319,8 @@ function main(args: string[]): number {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Creates metadata re-export file for a secondary entry-point. */
|
/** 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`);
|
const inputPath = path.join(srcDir, `${entryPointName}.metadata.json`);
|
||||||
writeFileFromInputPath(inputPath, JSON.stringify({
|
writeFileFromInputPath(inputPath, JSON.stringify({
|
||||||
'__symbolic': 'module',
|
'__symbolic': 'module',
|
||||||
|
@ -327,6 +329,7 @@ function main(args: string[]): number {
|
||||||
'exports':
|
'exports':
|
||||||
[{'from': `${srcDirRelative(inputPath, metadataFile.replace(/.metadata.json$/, ''))}`}],
|
[{'from': `${srcDirRelative(inputPath, metadataFile.replace(/.metadata.json$/, ''))}`}],
|
||||||
'flatModuleIndexRedirect': true,
|
'flatModuleIndexRedirect': true,
|
||||||
|
'importAs': packageName
|
||||||
}) + '\n');
|
}) + '\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue