Skip to content
This repository has been archived by the owner on Mar 27, 2020. It is now read-only.

Latest commit

 

History

History

plugin-watch

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

👀 plugin-watch

npm linux windows coverage deps

Watch for new or changed files matched by glob patterns.

Install

$ yarn add --dev @start/plugin-watch
# or
$ npm install --save-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/')
    )
  )