javascript - 如何解决 "Greetings, time traveller. We are in the golden age of prefix-less CSS, where Autoprefixer is no longer needed for your stylesheet."?

标签 javascript css next.js autoprefixer

在我的 Next.JS 应用程序中,我将样式表导入 _app.js像这样:

import '../public/css/Index.css';
Index.css包含这个:
.index-container {
    margin: 20px auto 0;
}
如何解决错误消息:

./src/public/css/Index.css (./node_modules/css-loader/dist/cjs.js??ref--5-oneOf-5-1!./node_modules/next/dist/compiled/postcss-loader??__nextjs_postcss!./src/public/css/Index.css) Warning

Greetings, time traveller. We are in the golden age of prefix-less CSS, where Autoprefixer is no longer needed for your stylesheet.

最佳答案

您的问题可以解决package.json通过应用以下代码:

 "browserslist": {
    "production": [
      ">0.3%",
      "not ie 11",
      "not dead", 
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version",
      ">0.3%",
      "not ie 11",
      "not dead", 
      "not op_mini all"
    ]
  }
进行这些更改后,重新启动服务器。您将不再收到此警告。

关于javascript - 如何解决 "Greetings, time traveller. We are in the golden age of prefix-less CSS, where Autoprefixer is no longer needed for your stylesheet."?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62883240/

相关文章:

javascript - Bing map - Javascript 与 Silverlight

javascript - Backbone.js 仍在验证失败时设置模型属性

next.js - 在Nextjs中,如何以编程方式触发服务端渲染?

css - React-tooltip 和 Next.js SSR 问题

javascript - 无法更新 Vuex 存储和检索数组

javascript - 为什么 document.off 禁用点击以 document.on 开始的按钮而不是 id.click 在 Jquery 中?

css - 为什么当设置盒子内部阴影时,chrome 会忽略边框半径?

css - 仅使用 css 将鼠标悬停在 div 上时缩放字体图标的大小?

jquery - 我的 div 不会居中 HTML CSS

javascript - Nextjs 中的样式组件延迟设置属性