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