我该如何解决“你好,时间旅行者.我们正处于无前缀 CSS 的黄金时代,您的样式表不再需要 Autoprefixer."? [英] 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."?

查看:64
本文介绍了我该如何解决“你好,时间旅行者.我们正处于无前缀 CSS 的黄金时代,您的样式表不再需要 Autoprefixer."?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的 Next.JS 应用程序中,我将我的样式表导入到 _app.js 中,如下所示:

In my Next.JS app I import my stylesheet in _app.js like this:

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/索引.css)警告

./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

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

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

推荐答案

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

Your issue can be solved package.json by applying code below:

 "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"
    ]
  }

完成这些更改后,重新启动服务器.您将不会再收到此警告.

After you have made these changes restart your server. you will no longer get this warning.

这篇关于我该如何解决“你好,时间旅行者.我们正处于无前缀 CSS 的黄金时代,您的样式表不再需要 Autoprefixer."?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆