Let's say your warning looked like this:
Module Warning (from ./node_modules/sass-loader/dist/cjs.js):
Deprecation Warning on line 53, column 13 of file:///C:/Users/Jarad/Documents/PyCharm/project/app/node_modules/bootstrap/scss/vendor/_rfs.scss:53:13:
Passing percentage units to the global abs() function is deprecated.
In the future, this will emit a CSS abs() function to be resolved by the browser.
To preserve current behavior: math.abs(100%)
To emit a CSS abs() now: abs(#{100%})
More info: https://sass-lang.com/d/abs-percent
53 | $dividend: abs($dividend);
...
To use ignoreWarnings
using regex based on the message, you could choose any text from the message:
module.exports = {
...
ignoreWarnings: [
{
message: /\$dividend: abs\(\$dividend\)/,
},
],
...
}
To use ignoreWarnings
with a function that returns true
or false
, you could use multiple conditions:
module.exports = {
...
ignoreWarnings: [
(warning) => {
// Ignoring Bootstrap SCSS deprecation warning for percentage units in abs() function
const msg = warning.message;
return (
msg.includes("Deprecation Warning") && msg.includes("_rfs.scss") && msg.includes("$dividend: abs($dividend)")
);
},
],
...
}