-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathGulpfile.js
89 lines (68 loc) · 1.87 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
// *************************************
//
// Gulpfile
//
// *************************************
//
// Available tasks:
// `gulp`
// `gulp test:css`
// `gulp test:js`
//
// *************************************
// -------------------------------------
// Modules
// -------------------------------------
//
// gulp : The streaming build system
// gulp-csscss : CSS redundancy analyzer
// gulp-jshint : JavaScript code quality tool
// gulp-load-plugins : Automatically load Gulp plugins
// gulp-parker : Stylesheet analysis tool
// gulp-plumber : Prevent pipe breaking from errors
//
// -------------------------------------
var gulp = require( 'gulp' );
var plugins = require( 'gulp-load-plugins' )();
// -------------------------------------
// Options
// -------------------------------------
var options = {
default : {
tasks : [ 'test:css', 'test:js' ]
},
css : {
file : 'build/assets/stylesheets/application.css'
},
js : {
file : 'build/assets/javascripts/application.js'
}
};
// -------------------------------------
// Task: Default
// -------------------------------------
gulp.task( 'default', function() {
options.default.tasks.forEach( function(task) {
gulp.start( task );
} );
} );
// -------------------------------------
// Task: Test CSS
// -------------------------------------
gulp.task( 'test:css', function() {
gulp.src( options.css.file )
.pipe( plugins.plumber() )
.pipe( plugins.parker() )
gulp.src( options.css.file )
.pipe( plugins.plumber() )
.pipe( plugins.csscss() )
});
// -------------------------------------
// Task: Test JS
// -------------------------------------
gulp.task( 'test:js', function() {
gulp.src( options.js.file )
.pipe( plugins.plumber() )
.pipe( plugins.jshint() )
.pipe( plugins.jshint.reporter( 'default' ) )
});