-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
55 lines (48 loc) · 1.34 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
46
47
48
49
50
51
52
53
54
55
/**
* Created by AkshayP on 12/15/2017.
*/
var gulp = require('gulp'),
gulpsync = require('gulp-sync')(gulp),
concat = require('gulp-concat'),
plumber = require('gulp-plumber'),
cssmin = require('gulp-cssmin'),
rename = require('gulp-rename'),
exec = require('gulp-exec'),
connect = require('gulp-connect'),
open = require('gulp-open');
gulp.task('css',function () {
return gulp.src('src/css/*.css')
.pipe(plumber())
.pipe(concat('customCheckbox.css'))
.pipe(gulp.dest('build/'));
});
gulp.task('css-min',function () {
return gulp.src('src/css/*.css')
.pipe(cssmin())
.pipe(concat('customCheckbox.css'))
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest('build/'));
});
gulp.task('html', function () {
gulp.src('./src/*.html')
.pipe(connect.reload());
});
gulp.task('connect', function() {
connect.server({
root: './',
port: 3002,
livereload: true
});
});
gulp.task('open', function(){
var options = {
uri: 'http://localhost:3002/src/',
app: 'chrome'
};
gulp.src('./src/index.html')
.pipe(open(options));
});
gulp.task('watch', function () {
gulp.watch(['css'], ['css-min'],['./src/*.html'], ['html']);
});
gulp.task('default',gulpsync.sync(['css','css-min','connect','open','watch']));