- 安装插件(autoprefixer 依赖于postcss 所以也要安装)
npm install postcss autoprefixer --save
- 配置 postcss.config.js
module.exports = {
'plugins': {
'autoprefixer': {}
}
}
- 运行项目如果出现一下问题 执行npm install [email protected] -D 降低版本
autoprefixer自动添加css前缀 - 最后随便写一句css运行项目查看 出现这种说明说明成功!
autoprefixer自动添加css前缀