Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@start/plugin-watch

deepsweet68MIT2.0.0TypeScript support: included

👀 Watch for new or changed files matched by glob patterns

tasks, runner, start, start-plugin, watch

readme

👀 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/')
    )
  )