symfony / encore:隐藏有关依赖项的警告

时间:2020-05-18 06:51:09

标签: webpack-encore

我正在努力隐藏来自无法修复的依赖项的警告。

我尝试过的事情:

  • 配置webpack config stats选项;但是后来我看到Encore实际上已经禁用了警告输出(当查看Encore.getWebpackConfig()的输出时)。
  • 为encore使用的friendly-errors-plugin编写一个转换器;将我不想看到的警告设置为null。但是,在转换之后,null值不会被过滤掉,从而导致崩溃(有点意义,因为它们不是过滤器;但是值得一试)

令我感到困惑的是,显然friendly-errors-webpack-plugin从webpack输出see source中获取了输入,但是即使我使用stats: false禁用了所有内容,警告仍然会显示。

简而言之;如何隐藏此警告:

 WARNING  Compiled with 1 warnings                                                                                                                                                                                                                                                                                     8:44:25 AM

 warning  in ./node_modules/moment/locale/en-SG.js

There are multiple modules with names that only differ in casing.
This can lead to unexpected behavior when compiling on a filesystem with other case-semantic.
Use equal casing. Compare these module identifiers:
* /home/famoser/Repos/mangelio/web/node_modules/moment/locale/en-SG.js
    Used by 2 module(s), i. e.
    /home/famoser/Repos/mangelio/web/node_modules/moment/locale sync /^\.\/.*$/
* /home/famoser/Repos/mangelio/web/node_modules/moment/locale/en-sg.js
    Used by 2 module(s), i. e.
    /home/famoser/Repos/mangelio/web/node_modules/moment/locale sync /^\.\/.*$/

1 个答案:

答案 0 :(得分:1)

是的,删除文件夹node_modules并安装yarn / npm即可解决此问题,谢谢!