mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-25 00:31:36 +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.
|
// Count the bundles.
|
||||||
.then((results) => {
|
.then((results) => {
|
||||||
const stdout = results[0].stdout;
|
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.');
|
throw new Error('Expected webpack to create a new chunk, but did not.');
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user