npm install px2rpx-loader
module.exports = {
// ...
module: {
rules: [{
test: /\.css$/,
use: [{
loader: 'style-loader'
}, {
loader: 'css-loader'
}, {
loader: 'px2rpx-loader',
// options here
options: {
rpxUnit: 1,
rpxPrecision: 6
}
}]
}]
}
}
Please see px2rpx for more information about query parameters of px2rpx.