标签:UNC web save import ade config code npm ref
npm install --save-dev postcss-loader
{
test:/\.css$/,
use:[
‘style-loader‘,
‘css-loader?importLoaders=1‘,
‘postcss-loader‘
]
}
一种办法是配置postcss.config.js
module.exports = {
plugins: [
require(‘autoprefixer‘)({
/* ...options */
})
]
}
第二张办法是webpack.config.js使用LoaderOptionsPlugin
module.exports = {
plugins: [
new webpack.LoaderOptionsPlugin({
options: {
postcss: function(){
return [
require("autoprefixer")({
browsers: [‘ie>=8‘,‘>1% in CN‘]
})
]
}
}
})
]
}
标签:UNC web save import ade config code npm ref
原文地址:https://www.cnblogs.com/qiqi715/p/9339204.html