Autoprefixer:配置

 

在webpack4 中配置

安装包:npm install webpack style-loader css-loader postcss-loader autoprefixer --save -dev

//webpack.config.js


{
  test:/\.css$/,
  use: [
  	{loader:'style-loader'},
  	{loader:'css-loader',
  	options:{
  		 modules:true,
  		importLoaders:1	   
  		}
  	},
  	{loader:'postcss-loader'}
  ]
}

//postcss.config.js

module.exports = {
    plugins: [
        require('autoprefixer')({
            "browsers": [
                "defaults",
                "not ie < 11",
                "last 2 versions",
                "> 1%",
                "iOS 7",
                "last 3 iOS versions"
            ]
        })
    ]
};

 

你可能感兴趣的:(Autoprefixer:配置)