-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
46 lines (35 loc) · 854 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
44
45
// JavaScript Document
var gulp = require('gulp'),
sass = require('gulp-ruby-sass'),
imagemin = require('gulp-imagemin'),
browsersync = require('browser-sync').create();
gulp.task('sass',function(){
return sass('scss/*.scss',{
style : 'compact'
})
.pipe(gulp.dest('css'))
.pipe(browsersync.stream());
});
gulp.task('image',function(){
gulp.src('simages/*.{png,gif,jpg,ico}')
.pipe(imagemin())
.pipe(gulp.dest('images'))
.pipe(browsersync.stream());
});
gulp.task('js',function(){
gulp.src('sjs/*.js')
.pipe(gulp.dest('js'))
.pipe(browsersync.stream());
});
gulp.task('reload',function(){
browsersync.init({
server : './',
file : [
'images/**'
]
});
gulp.watch('scss/*.scss',['sass']);
gulp.watch('sjs/*.js',['js']);
gulp.watch('simages/*',['image']);
gulp.watch('./*.html').on('change',browsersync.reload);;
});