Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'use strict';
- const gulp = require('gulp');
- const sass = require('gulp-sass');
- const browserSync = require('browser-sync');
- sass.compiler = require('node-sass');
- gulp.task('sass', function() {
- return gulp.src('./css/*.scss')
- .pipe(sass().on('error', sass.logError))
- .pipe(gulp.dest('./css'));
- });
- gulp.task('sass:watch', function() {
- gulp.watch('./css/*.scss', gulp.series('sass', browserSync.reload));
- });
- gulp.task('browser-sync', function() {
- const files = [
- './*.html',
- './css/*.css',
- './js/*.js',
- './img/*.{png,jpg,gif}',
- ];
- browserSync.init(files, {
- server: {
- baseDir: './',
- },
- });
- });
- gulp.task('default', gulp.series('browser-sync', 'sass:watch'));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement