Skip to content

Latest commit

 

History

History
46 lines (34 loc) · 760 Bytes

readme.md

File metadata and controls

46 lines (34 loc) · 760 Bytes

👀 plugin-watch

Watch for new or changed files matched by glob patterns.

Install

$ yarn add --dev @start/plugin-watch

Usage

Signature

watch(glob: string | string[], options?: {}): (target: StartPlugin)

options

chokidar options.

Example

import sequence from '@start/plugin-sequence'
import read from '@start/plugin-read'
import babel from '@start/plugin-lib-babel'
import write from '@start/plugin-write'
import watch from '@start/plugin-watch'

const babelConfig = {
  // …
  babelrc: false,
  sourceMap: true,
}

export const task = () =>
  watch('src/**/*.js')(
    sequence(
      read,
      babel(babelConfig),
      write('build/')
    )
  )