gulp.task('styles', () => { return gulp .src(routes.styles.scss) .pipe(plumber({})) .pipe(sass()) .pipe(gulp.dest(routes.files.css)) .pipe(browserSync.stream()); });
gulp.task('templates', ['styles'], () => { return gulp .src([routes.templates.pug, '!' + routes.templates._pug]) .pipe(pugLint()) .pipe(plumber({})) .pipe( pug({ locals: { emojis: lifes() }, }) ) .pipe(gulp.dest(routes.files.html)) .pipe(browserSync.stream()); });
gulp.task('watch', ['serve'], function() { gulp.watch(paths.source, ['build-system', browserSync.reload]).on('change', reportChange); gulp.watch(paths.html, ['build-html', browserSync.reload]).on('change', reportChange); gulp.watch(paths.style, ['build-styles']).on('change', reportChange); gulp.watch(paths.style, function() { return gulp.src(paths.style) .pipe(browserSync.stream()); }).on('change', reportChange); });
.pipe(browserSync.stream());
// copies changed css files to the output directory gulp.task('build-css', function() { return gulp.src(paths.css) .pipe(changed(paths.output, {extension: '.css'})) .pipe(gulp.dest(paths.output)) .pipe(browserSync.stream()); });
// this task wil watch for changes // to js, html, and css files and call the // reportChange method. Also, by depending on the // serve task, it will instantiate a browserSync session gulp.task('watch', ['serve'], function() { gulp.watch(paths.source, ['build-system', browserSync.reload]).on('change', reportChange); gulp.watch(paths.html, ['build-html', browserSync.reload]).on('change', reportChange); gulp.watch(paths.css, ['build-css']).on('change', reportChange); gulp.watch(paths.style, function() { return gulp.src(paths.style) .pipe(browserSync.stream()); }).on('change', reportChange); });
gulp.task('styles', () => { return gulp .src(routes.styles.scss) .pipe(plumber({})) .pipe(sass()) .pipe(gulp.dest(routes.files.css)) .pipe(browserSync.stream()); });
gulp.task('templates', ['styles'], () => { return gulp .src([routes.templates.pug, '!' + routes.templates._pug]) .pipe(pugLint()) .pipe(plumber({})) .pipe( pug({ locals: { emojis: lifes() }, }) ) .pipe(gulp.dest(routes.files.html)) .pipe(browserSync.stream()); });