Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions packages/ngtools/webpack/src/ivy/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ export class AngularWebpackPlugin {
!ignoreForEmit.has(sourceFile) &&
!angularCompiler.incrementalDriver.safeToSkipEmit(sourceFile)
) {
this.requiredFilesToEmit.add(sourceFile.fileName);
this.requiredFilesToEmit.add(normalizePath(sourceFile.fileName));
}
}

Expand All @@ -500,7 +500,7 @@ export class AngularWebpackPlugin {
mergeTransformers(angularCompiler.prepareEmit().transformers, transformers),
getDependencies,
(sourceFile) => {
this.requiredFilesToEmit.delete(sourceFile.fileName);
this.requiredFilesToEmit.delete(normalizePath(sourceFile.fileName));
angularCompiler.incrementalDriver.recordSuccessfulEmit(sourceFile);
},
);
Expand Down Expand Up @@ -589,11 +589,12 @@ export class AngularWebpackPlugin {
onAfterEmit?: (sourceFile: ts.SourceFile) => void,
): FileEmitter {
return async (file: string) => {
if (this.requiredFilesToEmitCache.has(file)) {
return this.requiredFilesToEmitCache.get(file);
const filePath = normalizePath(file);
if (this.requiredFilesToEmitCache.has(filePath)) {
return this.requiredFilesToEmitCache.get(filePath);
}

const sourceFile = program.getSourceFile(file);
const sourceFile = program.getSourceFile(filePath);
if (!sourceFile) {
return undefined;
}
Expand All @@ -620,7 +621,7 @@ export class AngularWebpackPlugin {
if (content !== undefined && this.watchMode) {
// Capture emit history info for Angular rebuild analysis
hash = hashContent(content);
this.fileEmitHistory.set(file, { length: content.length, hash });
this.fileEmitHistory.set(filePath, { length: content.length, hash });
}

const dependencies = [
Expand Down