@jsx6/build

0.2.4 • Public • Published

filters

During copy task you can transform the copied file content using filters.

config for filter contains

  • filter - function taht transforms and returns new value, but can return undefined to say no changes happened
  • include - list of include glob patterns
  • exclude - list of exclude glob patterns

example filter

const changeBg = {
  include: ['index.html'],
  exclude: [],
  filter: str => {
    let srch = 'background: #eee;'
    if (str.includes(srch)) return str.replace(srch, 'background: blue;')
  },
}

Readme

Keywords

Package Sidebar

Install

npm i @jsx6/build

Weekly Downloads

7

Version

0.2.4

License

MIT

Unpacked Size

343 kB

Total Files

14

Last publish

Collaborators

  • hrgdavor