diff --git a/packages/bazel/src/ng_package/packager.ts b/packages/bazel/src/ng_package/packager.ts index 603d8c5ef9..65733c52fe 100644 --- a/packages/bazel/src/ng_package/packager.ts +++ b/packages/bazel/src/ng_package/packager.ts @@ -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'); }