除了创建postcss.config.js外,我这种写法亲测可行,写在webpack.config.js的module中:
rules: [{
test: /\.css/,use: [{
loader:'style-loader'
},{
loader:'css-loader'
},{ loader: 'postcss-loader',options: {plugins: function () {return [require('autoprefixer')
];}}}]}]
rules: [{
test: /\.css/,use: [{
loader:'style-loader'
},{
loader:'css-loader'
},{ loader: 'postcss-loader',options: {plugins: function () {return [require('autoprefixer')
];}}}]}]
2017-03-05
windows的用户注意了!运行以下代码要将单引号变为双引号才可以通过编译。这狗币老师不提醒!
webpack hello.js hello.bundle.js --module-bind "css=style-loader!css-loader "
webpack hello.js hello.bundle.js --module-bind "css=style-loader!css-loader "
2017-03-04