Im kind of new to this. I have a good grasp on gulp but can't seem to figure out how to have gulp watch my file as prettier changes it. I tried but seem to hit a roadblock.
here's what I have so far. if i run the task on its own it works perfectly but I cant make it watch to any changes on save.
const gulp = require('gulp');
const pretty = require('gulp-pretty');
gulp.task('prettify', () =>
gulp
.src('src/**/*.js')
.pipe(
pretty({
singleQuote: true,
trailingComma: 'es5',
})
)
.pipe(gulp.dest('src/'))
);
gulp.task('watch', function() {
gulp.watch('src/*.js');
});
gulp.task('default', ['watch', 'prettify']);