warnings-to-errors-webpack-plugin icon indicating copy to clipboard operation
warnings-to-errors-webpack-plugin copied to clipboard

`warningsFilter` does not behave in the same manner as the default Webpack option

Open mf-pherlihy opened this issue 3 years ago • 1 comments

Followup to: https://github.com/taehwanno/warnings-to-errors-webpack-plugin/commit/07bcf4785d3cc13decf6cffdd76594215a8ebc35

This works if were targeting the warning message, but NOT the module id or context that triggered the warning.

Example Warning Object:

{
  message: 'Critical dependency: the request of a dependency is an expression',
  module: {
    context: '/local-path/node_modules/yargs',
	id: './node_modules/yargs/index.cjs',
  },
}
// Does NOT work
webpackOptions.stats.warningsFilter: [/node_modules\/yargs/i];

// Works
webpackOptions.stats.warningsFilter: ['the request of a dependency is an expression'];

Note: If this plugin is not used, the [/node_modules\/yargs/i] warning filter works fine -- they are just not transitioned to errors.

mf-pherlihy avatar Sep 30 '21 12:09 mf-pherlihy

thanks for reporting this. I will check this out soon.

taehwanno avatar Oct 04 '21 10:10 taehwanno