a webpack loader for vue projects to transform px units exiting in inline styles to rem units
npm install --save-dev vue-inline-px-to-rem
vue.config.js
module.exports = {
chainWebpack (config) {
...
config.module
.rule('vue')
.test(/\.vue$/)
.use('vue-inline-px-to-rem')
.loader('vue-inline-px-to-rem')
.options({
rootValue: 100
})
.end()
...
}
}
Name | Type | Default | Description |
---|---|---|---|
rootValue | Number | 100 | Represents the root element font size or returns the root element font size based on the input parameter |
- add unit testing
- add ignore-line or ignore-page feature