forked from t1m0n/air-datepicker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
48 lines (37 loc) · 1.24 KB
/
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'),
watch = require('gulp-watch'),
rename = require('gulp-rename'),
sass = require('gulp-sass'),
livereload = require('gulp-livereload'),
concat = require('gulp-concat');
gulp.task('js', function () {
gulp.src(['js/datepicker/datepicker.js', 'js/datepicker/cell.js'])
.pipe(concat('datepicker.js'))
.pipe(gulp.dest('dist/js/'))
.pipe(livereload())
});
gulp.task('sass', function () {
gulp.src('sass/datepicker.scss')
.pipe(sass().on('error', sass.logError))
.pipe(rename('datepicker.css'))
.pipe(gulp.dest('dist/css/'))
.pipe(livereload())
});
gulp.task('build', ['js', 'sass']);
gulp.task('pageSass', function () {
gulp.src('sass/page-init.scss')
.pipe(sass().on('error', sass.logError))
.pipe(rename('style.css'))
.pipe(gulp.dest('css/'))
.pipe(livereload())
});
gulp.task('watch', function () {
livereload.listen();
gulp.watch('sass/**/*.scss', ['pageSass', 'sass']).on('change', function (file) {
livereload.changed(file)
});
gulp.watch('js/**/*.js', ['js']).on('change', function (file) {
livereload.changed(file)
});
});
gulp.task('default', ['build', 'pageSass', 'watch']);