按官方文档配置如下,发现并不能起作用。
Webpack
In webpack you can use postcss-loader with autoprefixer
and other PostCSS plugins.
module.exports = {
module: {
rules: [
{
test: /\.css$/,
use: ["style-loader", "css-loader", "postcss-loader"]
}
]
}
}
And create a postcss.config.js with:
module.exports = {
plugins: [
require('autoprefixer')
]
}
到处查阅,经验证
发现需要package.json中配置browserlist,代码如下
package.json
{
"name": "webpackdemo",
"version": "1.0.0",
"description": "",
"private": true,
"scripts"