Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(@ngtools/webpack): Fix cache invalidation error when watching #5164

Closed
wants to merge 1 commit into from
Closed
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
7 changes: 7 additions & 0 deletions packages/@ngtools/webpack/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,13 @@ export class AotPlugin implements Tapable {
return;
}

// Create a new Program before compiling to invalidate source
// cache. Fixes error when watching for changes where the
// pre-save version of the file is used.
this._program = ts.createProgram(
this._rootFilePath, this._compilerOptions, this._compilerHost, this._program
);

// Create the Code Generator.
return __NGTOOLS_PRIVATE_API_2.codeGen({
basePath: this._basePath,
Expand Down