when webpack is packaged, I use extract-text-webpack-plugin, but don"t know how to generate sourcemap, and blindly try some configurations that don"t work.
webpack.config.js
{
test: /\.less$/,
use: ExtractTextPlugin.extract({
fallback: "style-loader",
use: [
{
loader: "css-loader",
options: {
sourceMap: true
}
},
{
loader: "postcss-loader",
options: {
config: {
path: "./postcss.config.js"
},
sourceMap: true
}
},
{
loader: "less-loader",
options: {
sourceMap: true
}
}
]
})
}
postcss.config.js
module.exports = {
plugins: {
"autoprefixer": "last 5 version",
// "postcss-px2rem": {}
}
}