npm install rpx2rem-loader
module.exports = {
// ...
module: {
rules: [{
test: /\.css$/,
use: [{
loader: 'style-loader'
}, {
loader: 'css-loader'
}, {
loader: 'rpx2rem-loader',
// options here
options: {
remUnit: 100,
remTag: 'rem',
remPrecision: 6,
}
}]
}]
}
}
Please see rpx2rem for more information about query parameters of rpx2rem.