vue-inline-px-to-rem

1.0.3 • Public • Published

vue-inline-px-to-rem

a webpack loader for vue projects to transform px units exiting in inline styles to rem units

Getting Started

Using npm to install vue-inline-px-to-rem

npm install --save-dev vue-inline-px-to-rem

Add the loader to your webpack config. For example:

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()
      ...
  }
}

Options

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

More

to-do-list

  • [ ] add unit testing
  • [ ] add ignore-line or ignore-page feature

Package Sidebar

Install

npm i vue-inline-px-to-rem

Weekly Downloads

5

Version

1.0.3

License

ISC

Unpacked Size

5.49 kB

Total Files

8

Last publish

Collaborators

  • hello-astar