-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
59 lines (50 loc) · 1.58 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
56
57
58
59
var gulp = require('gulp');
var plugins = require("gulp-load-plugins")({lazy:false});
gulp.task('scripts', function(){
//combine all js files of the app
gulp.src('./app/**/*.js')
.pipe(plugins.jshint())
.pipe(plugins.jshint.reporter('default'))
.pipe(plugins.concat('app.js'))
.pipe(gulp.dest('./build'));
});
gulp.task('css', function(){
gulp.src('./app/**/*.css')
.pipe(plugins.concat('app.css'))
.pipe(gulp.dest('./build'));
});
gulp.task('vendorJS', function(){
//concatenate vendor JS files
gulp.src('./bower_components/**/*.min.js')
.pipe(plugins.concat('lib.js'))
.pipe(gulp.dest('./build'));
});
gulp.task('vendorCSS', function(){
//concatenate vendor CSS files
gulp.src('./bower_components/**/*.min.css')
.pipe(plugins.concat('lib.css'))
.pipe(gulp.dest('./build'));
});
gulp.task('copy-index', function() {
gulp.src('./app/index.html')
.pipe(gulp.dest('./build'));
});
gulp.task('watch',function(){
gulp.watch([
'build/**/*.html',
'build/**/*.js',
'build/**/*.css'
], function(event) {
return gulp.src(event.path)
.pipe(plugins.connect.reload());
});
gulp.watch(['./app/**/*.js','!./app/**/*test.js'],['scripts']);
gulp.watch('./app/**/*.css',['css']);
gulp.watch('./app/index.html',['copy-index']);
});
gulp.task('connect', plugins.connect.server({
root: ['build'],
port: 9000,
livereload: true
}));
gulp.task('default',['connect','scripts','css','copy-index','vendorJS','vendorCSS','watch']);