提交 fef18922 编写于 作者: I Ilya Goncharov 提交者: TeamCityServer

[Gradle, JS] Changed API for warnings filter in Webpack 5

^KT-45621 fixed
上级 a113df8c
......@@ -33,24 +33,22 @@ class TeamCityErrorPlugin {
apply(compiler) {
compiler.hooks.done.tap('TeamCityErrorPlugin', (stats) => {
const warningsFilters = this.warningsFilter(stats.compilation.options.ignoreWarnings);
const compilation = stats.compilation;
const warningsFilters = this.warningsFilter(compilation.options.ignoreWarnings);
stats.compilation.errors.forEach(error => {
compilation.errors.forEach(error => {
const type = 'error';
if (error instanceof ModuleNotFoundError) {
const module = error.module;
module.dependencies.forEach(dependency => {
console[type](
formatMessage(TYPED_MESSAGE, `Module '${dependency.request}' not found in '${module.resource}'`, type));
});
return
console[type](
formatMessage(TYPED_MESSAGE, error.message, type)
);
} else {
console[type](formatMessage(TYPED_MESSAGE, error.message, type));
}
console[type](formatMessage(TYPED_MESSAGE, error.message, type));
});
stats.compilation.warnings
.filter(warning => warningsFilters.every(warningFilter => warningFilter(warning)))
compilation.warnings
.filter(warning => warningsFilters.some(warningFilter => !warningFilter(warning, compilation)))
.forEach(warning => {
const type = 'warn';
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册