2020-10-10 17:48:18 -04:00

24 lines
747 B
JavaScript

import gulp from 'gulp';
import {reloadServer, startServer} from './server';
import {scripts} from './tasks/scripts';
import {styles} from './tasks/styles';
import {extAllViews, views} from './tasks/views';
function reportWatchStats(path) {
console.log(`File ${path} was changed`);
}
export function watch() {
startServer();
gulp.watch(['packages/**/*.js', 'src/**/*.js'], gulp.series(scripts, reloadServer));
// only need to watch `styles` task, as it will `stream` changes to the server
const watchStyles = gulp.watch('src/**/*.scss', styles);
watchStyles.on('change', reportWatchStats);
const watchViews = gulp.watch(`src/**/${extAllViews}`, gulp.series(views, reloadServer));
watchViews.on('change', reportWatchStats);
}