我该如何解决“你好,时间旅行者.我们正处于无前缀 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."?
问题描述
在我的 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屋!