postcss的配置問(wèn)題
var htmlWebpackPlugin = require("html-webpack-plugin");
var path = require('path');
var webpack = require('webpack');
module.exports = {
?????entry: './src/app.js',
???? output: {
???? path: __dirname + '/dist',?
???? filename: 'js/[name]-bundle.js'
???? },
module: {
???? rules: [
???????? {
???????????? test: /\.js$/,
????????????include: '/src/', ? ? ?
???????????? exclude: '/node_modules/', ? ?
???????????? loaders: "babel-loader",?
???????????? query: {
???????????????? presets: ["latest"]
???????????????? }
???????? },
???????? {
? ? ? ? ? ? ? test:/\.css$/,
? ? ? ? ? ? ? use:[
? ? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? ? loader:'style-loader'
? ? ? ? ? ? ? ? ? },
? ? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? ? loader:'css-loader',
? ? ? ? ? ? ? ? ? ? ? options:{
? ? ? ? ? ? ? ? ? ? ? ? ? importLoaders:1
? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? },
? ? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? ? loader:'postcss-loader'
? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ]
? ? ? ? ? }
????]
},
plugins: [
????new htmlWebpackPlugin({
???? ????filename: 'index.html',?
???? ????template: 'index.html',?
???? ????inject: 'body',?
???? }),
????new webpack.LoaderOptionsPlugin({
???? ? ? ? ?options: {
???? ? ? ? ? ? ?postcss: function(){
???? ? ? ? ? ? ? ? ?return [
???? ? ? ? ? ? ? ? ? ? ?require('autoprefixer')({
???? ? ? ? ? ? ? ? ? ? ? ? ?broswers: ['last 5 versions']
???? ? ? ? ? ? ? ? ? ? ?})
???? ? ? ? ? ? ? ? ?]
???? ? ? ? ? ? ?}
???? ? ? ? ?}
???? ? ?})
????]
}
為什么我還是不行,我也已經(jīng)配置了postcss.config.js 文件了
module.exports = {
? ? plugins:[
? ? ? ? require('autoprefixer')({ browsers: ["last 5 versions"]})
? ? ]
}
還是報(bào)這個(gè)錯(cuò)
2017-10-24
2017-05-15
這么配置