天天看点

autoprefixer自动添加css前缀

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