-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathgulpfile.js
52 lines (45 loc) · 1018 Bytes
/
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
/*!
* Gulpfile
* since 2015-07-20
* author juanpablob <[email protected]>
*/
var argv = require('yargs').argv,
gulp = require('gulp'),
$ = require('gulp-load-plugins')(),
src = './src',
dist = './dist',
bower = './bower_components',
scripts = [
// Enqueue here your project's scripts
// Except this
src + '/**/*.js'
];
// Compile Scripts
gulp.task('scripts', function() {
gulp.src(scripts)
.pipe(gulp.dest(dist + '/'));
});
// Validate JS
gulp.task('jshint', function() {
gulp.src(src + '/**/*.js')
.pipe($.jshint())
.pipe($.jshint.reporter('default'));
});
gulp.watch(src + '/**/*.js', function() {
gulp.start('scripts');
gulp.start('jshint');
});
// Default
gulp.task('default', function() {
gulp.start('scripts');
gulp.start('jshint');
});
// Build for dist
gulp.task('build', function() {
gulp.src(src + '/**/*.js')
.pipe($.stripDebug())
.pipe(gulp.dest(dist + '/'))
.pipe($.jsmin())
.pipe($.rename({suffix: '.min'}))
.pipe(gulp.dest(dist + '/'));
});