我用的是webpack3.10.0的版本,配置webpack postcss-loader报错,慕课上视频是版本1
这是我的配置
const path = require('path');
const htmlWebpackPlugin = require('html-webpack-plugin');
const config = {
context: __dirname,
entry: './src/app.js',
output: {
path: path.resolve(__dirname, './dist'),
filename: 'js/[name].bundle.js'
},
module: {
loaders: [{
test: '/\.js$/',
loader: 'babel',
query: {
presets: ['latest']
}
}, {
test: /\.css$/,
loader: 'style-loader!css-loader!postcss-loader'
}]
},
postcss: [
require('autoprefixer')({
browsers: ['last 5 versions']
})
],
plugins: [
new htmlWebpackPlugin({
filename: 'index.html',
template: 'index.html',
inject: 'body'
})
]
}
module.exports = config;
报错如下图所示
请参考官方文档:https://webpack.js.org/loader...