forked from artfultom/whom-i-know
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
71 lines (62 loc) · 1.95 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
var gulp = require('gulp'),
cssmin = require('gulp-cssmin'),
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(inject(gulp.src(['src/share.html']), {
starttag: '<!-- inject:share -->',
transform: function (filePath, file) {
return file.contents.toString('utf8');
}
}))
.pipe(usemin({
css: [cssmin()],
js: [uglify()],
css_lib: [cssmin()],
js_lib: [uglify()]
}))
.pipe(gulp.dest('dist/'));
gulp.src('src/fonts/*')
.pipe(gulp.dest('dist/fonts'));
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'));
});