0.3.1 • Published 2 months ago

postcss-url-patch v0.3.1

Weekly downloads
-
License
ISC
Repository
github
Last release
2 months ago

postcssUrlPatch

  • replace the deprecated with base

    deprecated/a.png  => base/a.png
  • patch the base for the url without base

    a.png => base/a.png

options

interface Options {
  rules: Array<{
    base: string,  // 'new url base',
    deprecated?: string | RegExp, // 'deprecated url base',
    replace?: boolean  // replace the deprecated or not 
  }>
  replace?: boolean // replace the deprecated or not
  filter: RegExp // style selector
  exclude?: string | RegExp | ((path: string) => boolean) // exclude build dir, with default value /node_modules/i
  excludeUrl?: string | RegExp | ((path: string) => boolean) // exclude url value, with default value /assets/i,
  version?: VERSION // postcss 7 | 8
}

use

plugins: [
  postcssPxtorem({
    rootValue: 100,
    propList: ['*']
  }),
  postcssUrlReplace({
    rules: [
      {
        base: 'new url base',
        deprecated: 'deprecated url base',
      },
      // ...
    ],
    replace: false
  })
]
0.3.0

2 months ago

0.3.1

2 months ago

0.2.3

2 months ago

0.2.2

3 months ago

0.2.1

3 months ago

0.2.0

3 months ago

0.1.4

3 months ago

0.1.3

3 months ago

0.1.2

3 months ago

0.1.1

3 months ago

0.1.0

3 months ago

0.0.2

3 months ago