mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-24 16:16:27 +08:00
fix(@ngtools/webpack): correctly create Webpack5 file watcher
This commit is contained in:
parent
dbaf92386d
commit
2fa17219d1
@ -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;
|
||||
}
|
||||
|
@ -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.');
|
||||
}
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user