forked from artfultom/whom-i-know
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
63 lines (55 loc) · 1.69 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
var gulp = require('gulp'),
minifyCss = require('gulp-minify-css'),
uglify = require('gulp-uglify'),
concat = require('gulp-concat'),
del = require('del'),
inject = require('gulp-inject'),
karma = require('karma').server,
usemin = require('gulp-usemin');
gulp.task('default', ['clean', 'test'], function() {
gulp.start('build');
});
gulp.task('install', ['clean'], function() {
gulp.start('build');
});
gulp.task('clean', function(cb) {
del(['dist/*'], cb);
});
gulp.task('test', function (done) {
karma.start({
configFile: __dirname + '/karma.conf.js',
singleRun: true
}, done);
});
gulp.task('tdd', function (done) {
karma.start({
configFile: __dirname + '/karma.conf.js'
}, done);
});
gulp.task('build', function () {
gulp.src('src/index.html')
.pipe(inject(gulp.src(['src/analytics.html']), {
starttag: '<!-- inject:analytics -->',
transform: function (filePath, file) {
return file.contents.toString('utf8');
}
}))
.pipe(inject(gulp.src(['src/forkme.html']), {
starttag: '<!-- inject:forkme -->',
transform: function (filePath, file) {
return file.contents.toString('utf8');
}
}))
.pipe(usemin({
css: [minifyCss()],
js: [uglify()],
css_lib: [],
css_lib_min: [minifyCss()],
js_lib: [],
}))
.pipe(gulp.dest('dist/'));
gulp.src('src/bower_components/bootstrap/fonts/*')
.pipe(gulp.dest('dist/fonts'));
gulp.src('src/bower_components/jquery/dist/jquery.min.map')
.pipe(gulp.dest('dist/js'));
});