mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-24 08:06:17 +08:00
21 lines
570 B
TypeScript
21 lines
570 B
TypeScript
// Don't emit anything when there are compilation errors. This is useful for preventing Karma
|
|
// from re-running tests when there is a compilation error.
|
|
// Workaround for https://github.com/webpack-contrib/karma-webpack/issues/49
|
|
|
|
export class KarmaWebpackEmitlessError {
|
|
constructor() { }
|
|
|
|
apply(compiler: any): void {
|
|
compiler.plugin('done', (stats: any) => {
|
|
if (stats.compilation.errors.length > 0) {
|
|
stats.stats = [{
|
|
toJson: function () {
|
|
return this;
|
|
},
|
|
assets: []
|
|
}];
|
|
}
|
|
});
|
|
}
|
|
}
|