fix(ivy): ngcc - compute potential d.ts files from .js files (#31411)

If a package delcares a class internally on an NgModule, ngcc
needs to be able to add a public export to this class's type.

Previously, if the typing file for the declared is not imported
from the typings entry-point file, then ngcc cannot find it.
Now we try to guess the .d.ts files from the equivalent .js
files.

PR Close #31411
This commit is contained in:
Pete Bacon Darwin
2019-07-03 19:31:33 +01:00
committed by Jason Aden
parent e6f1b04cd5
commit 83b19bf1a2
4 changed files with 92 additions and 13 deletions

View File

@ -154,7 +154,8 @@ export function mainNgcc(
// the property as processed even if its underlying format has been built already.
if (!compiledFormats.has(formatPath) && (compileAllFormats || isFirstFormat)) {
const bundle = makeEntryPointBundle(
fileSystem, entryPoint, formatPath, isCore, property, format, processDts, pathMappings);
fileSystem, entryPoint, formatPath, isCore, property, format, processDts, pathMappings,
true);
if (bundle) {
logger.info(`Compiling ${entryPoint.name} : ${property} as ${format}`);
const transformedFiles = transformer.transform(bundle);