完美解决autoprefixer前缀不全的写法!
1.先安装 postcss-loader和autoprefixer
2.填写配置
module:{ rules:[ { // 实现样式文件导入解析 test:/\.(css|scss|sass|less)$/, use:['style-loader','css-loader','sass-loader',{ loader:'postcss-loader', options:{ plugins:[ require('autoprefixer')() ] } }] }, ] }
(1)然后执行打包命令,打包后在控制台查看,
{ // 实现样式文件导入解析 test:/\.(css|scss|sass|less)$/, use:['style-loader','css-loader','sass-loader',{ loader:'postcss-loader', options:{ plugins:[ require('autoprefixer')( { browsers: [ 'last 10 Chrome versions', 'Firefox >= 3.5', 'Opera >= 11.5', 'ie >8' ] } ) ] } }] },
下面是效果图: