forked from jansanchez/gulp-recursive-concat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
54 lines (42 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
46
47
48
49
50
51
52
53
54
'use strict';
var gulp = require('gulp'),
jshint = require('gulp-jshint'),
watch = require('gulp-watch'),
clean = require('gulp-clean'),
stylish = require('jshint-stylish'),
complexity = require('gulp-complexity');
var path = { src: {} };
path.src.js = ['./index.js', './lib/*.js'];
path.src.complexity = ['./index.js', './lib/*.js'];
gulp.task('default', ['lint'], function() {
console.log('All the Javascript.');
});
gulp.task('lint', function() {
return gulp.src(path.src.js)
.pipe(jshint('.jshintrc'))
.pipe(jshint.reporter('jshint-stylish'))
.pipe(jshint.reporter('fail'));
});
gulp.task('watch', function () {
var javascriptTasks = ['lint'];
gulp.watch(path.src.js, javascriptTasks);
});
/*
gulp.task('complexity', function(){
return gulp.src(path.src.complexity)
.pipe(complexity());
});
*/
var recursiveConcat = require('./index');
gulp.task('clean', function () {
return gulp.src('demo/dist/*')
.pipe(clean({read: false, force: true}));
});
gulp.task('concat', ['clean', 'concatenation'], function() {
console.log('Ok.');
});
gulp.task('concatenation', function(){
return gulp.src('./demo/source/**/*.js')
.pipe(recursiveConcat({dist: 'demo/dist/', extname: ".js", debug: true}))
.pipe(gulp.dest('demo/dist/'));
});