Watch for new or changed files matched by glob patterns.
$ yarn add --dev @start/plugin-watch
# or
$ npm install --save-dev @start/plugin-watch
watch(glob: string | string[], options?: {}): (target: StartPlugin)
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/')
)
)