报错Replace Autoprefixer browsers option to Browserslist config.


问题描述:
Copy
Replace Autoprefixer browsers option to Browserslist config.
Use browserslist key in package.json or .browserslistrc file.
Using browsers option cause some error. Browserslist config
can be used for Babel, Autoprefixer, postcss-normalize and other tools.
If you really need to use option, rename it to overrideBrowserslist.
因为postCss版本更新,之前版本的配置已无效:

Copy
module.exports = {
plugins: [
require('autoprefixer')({
browsers: ['last 100 versions']
})// 自动添加css前缀
]
}
更换为:

Copy
module.exports = {
plugins: [
require('autoprefixer')({overrideBrowserslist: ['> 0.15% in CN']})// 自动添加css前缀
]
}
即可解决


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM