-
Notifications
You must be signed in to change notification settings - Fork 8
/
gulpfile.js
39 lines (32 loc) · 891 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
'use strict';
var gulp = require('gulp');
var jshint = require('gulp-jshint');
var uglify = require('gulp-uglify');
var inline = require('gulp-inline');
var files = ['src/*.*', 'tests/spec/*.js'];
gulp.task('lint', function() {
gulp.src(files)
.pipe(jshint.extract('always'))
.pipe(jshint('.jshintrc'))
.pipe(jshint.reporter('jshint-stylish'));
});
gulp.task('build', function() {
return gulp.src('src/pushstate-anchor.js')
.pipe(uglify())
.pipe(gulp.dest('.'));
});
gulp.task('minify', function() {
return gulp.src('src/pushstate-anchor.html')
.pipe(inline({
base: 'src',
js: uglify()
}))
.pipe(gulp.dest('.'));
});
gulp.task('watch', function() {
// gulp.run('lint', 'build', 'minify');
gulp.watch(files, ['lint', 'build', 'minify']);
});
gulp.task('default', ['lint', 'build', 'minify']);
// CI build
gulp.task('ci', ['lint']);