【问题标题】:remove autoprefixer warning in react 17.0.2删除反应 17.0.2 中的自动前缀警告
【发布时间】:2021-09-22 04:46:30
【问题描述】:

我目前正在使用 React 17.0.2(在 create-react-app 环境中)和 SCSS,突然之间,我不断收到以下警告反应

你好,时间旅行者。我们正处于无前缀 CSS 的黄金时代,您的样式表不再需要 Autoprefixer。

我没有更新任何东西(至少据我所知),而且我使用的 Sass 编译器禁用了自动前缀。

我已尝试关注此线程上的所有答案:How do I solve "Greetings, time traveller. We are in the golden age of prefix-less CSS, where Autoprefixer is no longer needed for your stylesheet."?
然后运行npm update --save 无济于事。

警告不断混淆重要的消息和错误,处理起来非常痛苦,因此感谢所有帮助。

【问题讨论】:

  • 您使用哪个代码来创建新项目? npm create-react-app 或 npx create-react-app
  • 这应该是一条评论。但是,我使用了npx
  • 我用 npx 做了一个新项目,但我们没有警告请测试此代码 npm audit fixyarn audit fix

标签: javascript node.js reactjs sass


【解决方案1】:

检查您构建的 react 文件夹并确认 CSS 文件以查看是否有供应商前缀?如果是这样,请尝试以下操作:

.b { /* autoprefixer: off */ transition: 1s; }.

autoprefixer comment

【讨论】:

    猜你喜欢
    • 2022-06-19
    • 2021-07-10
    • 2018-07-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-07-08
    • 1970-01-01
    相关资源
    最近更新 更多