fix(ivy): reexport compileNgModuleFactory__POST_NGCC__ to prevent DCE in FESM (#26071)

While creating FESM files, rollup usually drops all unused symbols.
All *__POST_NGCC__ are unused unless ngcc rewires stuff. To prevent this DCE
we reexport them as private symbols. If ngcc is not used, these symbols will
be dropped when we optimize an application bundle.

PR Close #26071
This commit is contained in:
JoostK 2018-09-23 22:44:07 +02:00 committed by Jason Aden
parent 3cce4afa0d
commit 9953fe7c00
2 changed files with 4 additions and 1 deletions

View File

@ -43,7 +43,7 @@ function compileNgModuleFactory__PRE_NGCC__<M>(
return compiler.compileModuleAsync(moduleType);
}
function compileNgModuleFactory__POST_NGCC__<M>(
export function compileNgModuleFactory__POST_NGCC__<M>(
injector: Injector, options: CompilerOptions,
moduleType: Type<M>): Promise<NgModuleFactory<M>> {
ngDevMode && assertNgModuleType(moduleType);

View File

@ -175,6 +175,9 @@ export {
// performed by rollup while it's creating fesm files.
//
// no code actually imports these symbols from the @angular/core entry point
export {
compileNgModuleFactory__POST_NGCC__ as ɵcompileNgModuleFactory__POST_NGCC__
} from './application_ref';
export {
R3_COMPILE_COMPONENT__POST_NGCC__ as ɵR3_COMPILE_COMPONENT__POST_NGCC__,
R3_COMPILE_DIRECTIVE__POST_NGCC__ as ɵR3_COMPILE_DIRECTIVE__POST_NGCC__,