-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
47 lines (41 loc) · 1.13 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
//init modules
var gulp = require('gulp')
var gutil = require('gulp-util')
var uglify = require('gulp-uglifycss')
var jshint = require('gulp-jshint')
var watch = require('gulp-watch')
var concat = require('gulp-concat');
var rename = require('gulp-rename');
//tasks
gulp.task('distjs', function(){
return gulp
.src('./app/js/*.js')
.pipe(concat('dist/js'))
.pipe(rename('main.min.js'))
.pipe(uglify())
.pipe(gulp.dest('dist/js'));
});
gulp.task('distcss', function(){
return gulp
.src('app/css/*.css')
.pipe(concat('dist/css'))
.pipe(rename('main.min.css'))
.pipe(uglify())
.pipe(gulp.dest('dist/css'));
});
//IMPLEMENT this task!!!
// gulp.task('libs-dist', function(){
// return gulp
// .src('app/libraries/???')
// .pipe(gulp.dest('dist/libraries/???'));
// });
gulp.task('test', function(){
return gulp
.src('app/js/*.js')
.pipe(jshint())
.pipe(jshint.reporter('default'));
});
gulp.task('watch', function(){
gulp.watch('./app/js/*.js',['distjs','distcss','test']);
});
gulp.task('default', ['distjs','distcss','test','watch']);