npm install start-watch




Watch task for Start.
``sh`
npm install --save-dev start-watchor
yarn add --dev start-watch
`js
import Start from 'start';
import reporter from 'start-pretty-reporter';
import files from 'start-files';
import clean from 'start-clean';
import watch from 'start-watch';
import read from 'start-read';
import babel from 'start-babel';
import write from 'start-write';
import mocha from 'start-mocha';
import inputConnector from 'start-input-connector';
cosnt start = Start(reporter());
export const dev = () => start(
files('build/'),
clean(),
watch('lib/*/.js')((changedFiles) => start(
inputConnector(changedFiles),
read(),
babel(),
write('build/')
))
);
`
See documentation for details.
:point_right: Note that this task may not work properly with tasks like start-webpack and start-karma which have their own file watching functionality.
watch(files, events, options)(callback)
* files – Chokidar "file, dir, glob, or array"events
* – Chokidar events array, [ 'change', 'add' ] by defaultoptions
* – Chokidar options, { persistent: true } by defaultcallback(changedFiles)` – callback function which will be called with an array of matched and changed files
*