forked from egsonweb/example-todos-jquery
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
44 lines (36 loc) · 941 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
38
39
40
41
42
43
var gulp = require('gulp');
var sass = require('gulp-sass');
var browserSync = require('browser-sync').create();
// Server task
gulp.task('server', ['copy', 'sass', 'scripts'], function() {
browserSync.init({
server: './build'
});
});
// Copy task
gulp.task('copy', function() {
gulp.src('app/index.html')
.pipe(gulp.dest('build/'))
.pipe(browserSync.stream());
});
// Sass task
gulp.task('sass', function() {
gulp.src('app/sass/*.scss')
.pipe(sass({
outputStyle: 'compressed'
}))
.pipe(gulp.dest('build/css'))
.pipe(browserSync.stream());
});
// Scripts task
gulp.task('scripts', function(){
gulp.src('app/scripts/*.js')
.pipe(gulp.dest('build/js'));
});
// Watch task
gulp.task('watch', function() {
gulp.watch('app/index.html', ['copy']);
gulp.watch('app/sass/*.scss', ['sass']);
gulp.watch('app/scripts/*.js', ['scripts']);
});
gulp.task('default', ['server', 'watch']);