在我的 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/