-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
37 lines (29 loc) · 871 Bytes
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
var gulp = require('gulp');
var browserSync = require('browser-sync').create();
var sass = require('gulp-sass');
gulp.task('scripts', function() {
gulp.src(['./js/*.js'])
.pipe(gulp.dest('./js'))
.pipe(browserSync.reload({stream: true}));
});
gulp.task('styles', function() {
gulp.src(['./assets/sass/main.scss'])
.pipe(sass())
.pipe(gulp.dest('./assets/css'))
.pipe(browserSync.reload({stream: true}));
});
gulp.task('serve', function() {
browserSync.init({
server: {
baseDir: './'
}
});
gulp.watch('./js/**', function(event) {
gulp.run('scripts');
})
gulp.watch('./assets/sass/*.scss', function(event) {
gulp.run('styles');
})
gulp.watch('./**/*.html').on('change', browserSync.reload);
});
gulp.task('default', ['scripts', 'styles', 'serve']);