gpt4 book ai didi

javascript - Webpack:抑制来自特定文件的警告

转载 作者:行者123 更新时间:2023-12-05 05:57:04 25 4
gpt4 key购买 nike

我试图抑制一些 FontAwesome Sass 编译警告,这些警告显然无法从我这边修复:

config.ignoreWarnings = [
{
file: /_bootstrap\.scss$/i
}
]

但警告不会被忽略或抑制。也许 ignoreWarnings 不会抑制编译警告?无论如何,如何忽略编译此 Sass 文件时生成的警告?

生成的警告

DEPRECATION WARNING: Using / for division is deprecated and will be removed in Dart Sass 2.0.0.

Recommendation: math.div(20em, 16)

More info and automated migrator: https://sass-lang.com/d/slash-div


12 │ $fa-fw-width: (20em / 16);
│ ^^^^^^^^^

node_modules\@fortawesome\fontawesome-free\scss\_variables.scss 12:25 @import
node_modules\@fortawesome\fontawesome-free\scss\fontawesome.scss 5:9 @import
assets\styles\_bootstrap.scss 4:9 @import
assets\styles\app.scss 1:9 root stylesheet

DEPRECATION WARNING: Using / for division is deprecated and will be removed in Dart Sass 2.0.0.

Recommendation: math.div(4em, 3)

More info and automated migrator: https://sass-lang.com/d/slash-div


6 │ font-size: (4em / 3);
│ ^^^^^^^

node_modules\@fortawesome\fontawesome-free\scss\_larger.scss 6:15 @import
node_modules\@fortawesome\fontawesome-free\scss\fontawesome.scss 8:9 @import
assets\styles\_bootstrap.scss 4:9 @import
assets\styles\app.scss 1:9 root stylesheet

DEPRECATION WARNING: Using / for division is deprecated and will be removed in Dart Sass 2.0.0.

Recommendation: math.div(3em, 4)

More info and automated migrator: https://sass-lang.com/d/slash-div


7 │ line-height: (3em / 4);
│ ^^^^^^^

node_modules\@fortawesome\fontawesome-free\scss\_larger.scss 7:17 @import
node_modules\@fortawesome\fontawesome-free\scss\fontawesome.scss 8:9 @import
assets\styles\_bootstrap.scss 4:9 @import
assets\styles\app.scss 1:9 root stylesheet

DEPRECATION WARNING: Using / for division is deprecated and will be removed in Dart Sass 2.0.0.

Recommendation: math.div($fa-li-width * 5, 4)

More info and automated migrator: https://sass-lang.com/d/slash-div


6 │ margin-left: $fa-li-width * 5/4;
│ ^^^^^^^^^^^^^^^^^^

node_modules\@fortawesome\fontawesome-free\scss\_list.scss 6:16 @import
node_modules\@fortawesome\fontawesome-free\scss\fontawesome.scss 10:9 @import
assets\styles\_bootstrap.scss 4:9 @import
assets\styles\app.scss 1:9 root stylesheet

DONE Compiled successfully in 7725ms

最佳答案

在我的例子中,使用 file regex 不起作用,我改用 module regex 修复了它

不工作

ignoreWarnings: [
{
file: /path\/to\/file\/style.scss$/,
message: /the warning/,
},
],

工作

ignoreWarnings: [
{
module: /path\/to\/file\/style.scss$/,
message: /the warning/,
},
],

关于javascript - Webpack:抑制来自特定文件的警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68928352/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com