-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
49 lines (43 loc) · 1.01 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
'use strict';
// Include Gulp & Tools We'll Use
var gulp = require('gulp');
var $ = require('gulp-load-plugins')();
var runSequence = require('run-sequence');
var inlinesource = require('gulp-inline-source');
var bump = require('gulp-bump');
//Lint JavaScript
gulp.task('jshint', function () {
return gulp.src([
'src/*.js',
'src/*.html'
])
.pipe($.jshint.extract()) // Extract JS from .html files
.pipe($.jshint())
.pipe($.jshint.reporter('jshint-stylish'));
});
//JavaScript Code Style
gulp.task('jscs', function () {
return gulp.src([
'src/**/*.js'
])
.pipe($.jscs());
});
gulp.task('inlinesource', function () {
var options = {
compress: false
};
return gulp.src('./src/*.html')
.pipe(inlinesource(options))
.pipe(gulp.dest('./'));
});
gulp.task('bump', function(){
gulp.src('./bower.json')
.pipe(bump())
.pipe(gulp.dest('./'));
});
gulp.task('default', function (callback) {
runSequence(
['jshint', 'jscs'],
'inlinesource',
callback);
});