Skip to content

Commit

Permalink
fix(@ngtools/webpack): correctly create Webpack5 file watcher
Browse files Browse the repository at this point in the history
  • Loading branch information
clydin authored and filipesilva committed Oct 14, 2020
1 parent dbaf923 commit 2fa1721
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Expand Up @@ -295,5 +295,6 @@ export class VirtualWatchFileSystemDecorator extends NodeWatchFileSystem {
};
}

watch = isWebpackFiveOrHigher() ? this.createWebpack5Watch : this.createWebpack4Watch();
// tslint:disable-next-line: no-any
watch = isWebpackFiveOrHigher() ? this.createWebpack5Watch() : this.createWebpack4Watch() as any;
}
3 changes: 2 additions & 1 deletion tests/legacy-cli/e2e/tests/basic/rebuild.ts
Expand Up @@ -49,7 +49,8 @@ export default function() {
// Count the bundles.
.then((results) => {
const stdout = results[0].stdout;
if (!/(lazy-module|0)\.js/g.test(stdout)) {
// First regexp is for Webpack 4; Second is for Webpack 5
if (!/(lazy-module|0)\.js/g.test(stdout) && !/lazy_module_ts\.js/g.test(stdout)) {
throw new Error('Expected webpack to create a new chunk, but did not.');
}
})
Expand Down

0 comments on commit 2fa1721

Please sign in to comment.