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 compilation not working properly with webpack-dev-server #4009

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

// Create a new Program before compiling to get the latest source file contents,
// otherwise when using webpack-dev-server the files will be outdated at this point
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