0.1.5 • Published 1 year ago

unplugin-px-to-rem v0.1.5

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

unplugin-px-to-rem

NPM version

transform px to rem, you can specify the directory you want to convert to

Usage

optionsdesctypedefault
endWithfiles typestring[][]
excludedirectory that is not includedstring[][]
dirsdirectory that is includedstring[][]
fontBaseconversion rationumber16

Install

npm i unplugin-px-to-rem -D
// vite.config.ts
import UnpluginPxToRem from 'unplugin-px-to-rem/vite'

export default defineConfig({
  plugins: [
    UnpluginPxToRem ({ /* options */ }),
  ],
})

Example: playground/

// rollup.config.js
import UnpluginPxToRem  'unplugin-px-to-rem/rollup'

export default {
  plugins: [
    UnpluginPxToRem ({ /* options */ }),
  ],
}

// webpack.config.js
module.exports = {
  /* ... */
  plugins: [
    require('unplugin-px-to-rem/webpack')({ /* options */ })
  ]
}

// nuxt.config.js
export default {
  buildModules: [
    ['unplugin-px-to-rem/nuxt', { /* options */ }],
  ],
}

This module works for both Nuxt 2 and Nuxt Vite

// vue.config.js
module.exports = {
  configureWebpack: {
    plugins: [
      require('unplugin-px-to-rem/webpack')({ /* options */ }),
    ],
  },
}

Example: playground2/

// esbuild.config.js
import { build } from 'esbuild'
import UnpluginPxToRem from 'unplugin-px-to-rem/esbuild'

build({
  plugins: [UnpluginPxToRem ()],
})

0.1.5

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago