postcss-loader配置好了,运行之后也没有报错,可是在浏览器中查看并没有加上前缀,问什么?
postcss-loader配置好了,运行之后也没有报错,可是在浏览器中查看并没有加上前缀,好疑惑??麻烦老师、大神帮忙看下,谢谢!!
以下是代码:
var htmlWebpackPlugin=require("html-webpack-plugin");
var path=require('path');
var webpack = require('webpack');
module.exports={
entry:"./src/app.js",
output:{
path:"/webpack_demo/dist",
filename:"js/[name].js",
},
module:{
rules:[
{
test:/\.js$/,
loader:'babel-loader',
exclude:path.resolve(__dirname,'node_modules'),
include:path.resolve(__dirname,'src/'),
query:{
presets:['latest']
}
},
{
test:/.\css$/,
loader:'style-loader!css-loader?importLoaders=1!postcss-loader'
}
]
},
plugins:[
new htmlWebpackPlugin({
template:"index.html",
filename:"index.html",
inject:"body"
}),
new webpack.LoaderOptionsPlugin({
options: {
postcss: function() {
return [
require('autoprefixer')({
broswers: ['last 5 versions']
})
]
}
}
})
]
}