diff --git a/packages/ngtools/webpack/src/virtual_file_system_decorator.ts b/packages/ngtools/webpack/src/virtual_file_system_decorator.ts index 484060f5e0..65ad145b3c 100644 --- a/packages/ngtools/webpack/src/virtual_file_system_decorator.ts +++ b/packages/ngtools/webpack/src/virtual_file_system_decorator.ts @@ -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; } diff --git a/tests/legacy-cli/e2e/tests/basic/rebuild.ts b/tests/legacy-cli/e2e/tests/basic/rebuild.ts index 18e84f7e20..8f2ef17dae 100644 --- a/tests/legacy-cli/e2e/tests/basic/rebuild.ts +++ b/tests/legacy-cli/e2e/tests/basic/rebuild.ts @@ -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.'); } })