我正在开发 angular 应用程序,在运行应用程序时它没有显示任何错误,但我在许多 css 文件中收到这种警告。
Module Warning (from ./node_modules/postcss-loader/src/index.js):
Warning
(114:1) @import must precede all other statements (besides @charset)
我在 114 线上导入的是这个。
@import url(http://netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css);
我曾经在所有显示此类警告的 css 中像这样导入。
有什么解决办法吗?
最佳答案
我想通过两个屏幕截图来解释它为什么会发出警告。
因为你没有使用 @import ....在第一行。
请参阅此屏幕截图,它发出警告。
见下面的截图这是解决方案:
警告已经消失,因为我在 style.css 文件的第一行使用了 @import ... 行。
关于css - 警告 : @import must precede all other statements (besides @charset),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58004095/