-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
45 lines (41 loc) · 955 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
var gulp = require("gulp"),
browserSync = require('browser-sync'),
modernizr = require('gulp-modernizr');
// Сборка файла modernizr
gulp.task('modernizr', function() {
gulp.src('app/js/*.js')
.pipe(modernizr({
'options': [
'setClasses',
'html5shiv'
],
'tests': [
'placeholder',
'csstransforms',
'cssgradients',
'rgba',
'opacity'
],
'uglify': true
}))
.pipe(gulp.dest("app/js/vendor"))
});
// Сервер
gulp.task('server', function () {
browserSync({
port: 9000,
server: {
baseDir: 'app'
}
});
});
// Слежка
gulp.task('watch', function () {
gulp.watch([
'app/*.html',
'app/js/**/*.js',
'app/css/**/*.css'
]).on('change', browserSync.reload);
});
// Задача по-умолчанию
gulp.task('default', ['modernizr','server', 'watch']);