diff --git a/src/lib/ng-package/entry-point/analyse-sources.transform.ts b/src/lib/ng-package/entry-point/analyse-sources.transform.ts index f11f9d2a9..c0b491c69 100644 --- a/src/lib/ng-package/entry-point/analyse-sources.transform.ts +++ b/src/lib/ng-package/entry-point/analyse-sources.transform.ts @@ -54,7 +54,6 @@ function analyseEntryPoint(graph: BuildGraph, entryPoint: EntryPointNode, entryP moduleResolutionCache, undefined, undefined, - undefined, analysesSourcesFileCache, ); diff --git a/src/lib/ngc/compile-source-files.ts b/src/lib/ngc/compile-source-files.ts index f81090649..384643ea2 100644 --- a/src/lib/ngc/compile-source-files.ts +++ b/src/lib/ngc/compile-source-files.ts @@ -33,13 +33,11 @@ export async function compileSourceFiles( ); } - const emittedFiles = new Set(); const tsCompilerHost = cacheCompilerHost( graph, entryPoint, tsConfigOptions, moduleResolutionCache, - emittedFiles, stylesheetProcessor, inlineStyleLanguage, ); @@ -188,28 +186,16 @@ export async function compileSourceFiles( log.msg(formatDiagnostics(errorDiagnostics)); } - const transformers = angularCompiler.prepareEmit().transformers; - if ('getSemanticDiagnosticsOfNextAffectedFile' in builder) { - // TypeScript will loop until there are no more affected files in the program - while (builder.emitNextAffectedFile(undefined, undefined, undefined, transformers)) { - // empty - } - } - if (errorDiagnostics.length) { throw new Error(formatDiagnostics(errorDiagnostics)); } + const transformers = angularCompiler.prepareEmit().transformers; for (const sourceFile of builder.getSourceFiles()) { if (ignoreForEmit.has(sourceFile)) { continue; } - if (emittedFiles.has(sourceFile.fileName)) { - angularCompiler.incrementalCompilation.recordSuccessfulEmit(sourceFile); - continue; - } - if (angularCompiler.incrementalCompilation.safeToSkipEmit(sourceFile)) { continue; } diff --git a/src/lib/ts/cache-compiler-host.ts b/src/lib/ts/cache-compiler-host.ts index f88741b7f..2f38e9701 100644 --- a/src/lib/ts/cache-compiler-host.ts +++ b/src/lib/ts/cache-compiler-host.ts @@ -18,7 +18,6 @@ export function cacheCompilerHost( entryPoint: EntryPointNode, compilerOptions: CompilerOptions, moduleResolutionCache: ts.ModuleResolutionCache, - emittedFiles?: Set, stylesheetProcessor?: StylesheetProcessor, inlineStyleLanguage?: NgPackageConfig['inlineStyleLanguage'], sourcesFileCache: FileCache = entryPoint.cache.sourcesFileCache, @@ -104,7 +103,6 @@ export function cacheCompilerHost( } sourceFiles.forEach(source => { - emittedFiles?.add(source.fileName); const cache = sourcesFileCache.getOrCreate(source.fileName); if (!cache.declarationFileName) { cache.declarationFileName = ensureUnixPath(fileName); @@ -127,10 +125,6 @@ export function cacheCompilerHost( version, map, }); - - sourceFiles.forEach(source => { - emittedFiles?.add(source.fileName); - }); } compilerHost.writeFile.call(this, fileName, data, writeByteOrderMark, onError, sourceFiles);