forked from brandly/angular-youtube-embed
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
60 lines (53 loc) · 1.37 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
var
gulp = require('gulp'),
uglify = require('gulp-uglify'),
karma = require('gulp-karma'),
rename = require('gulp-rename'),
header = require('gulp-header'),
express = require('express'),
gutil = require('gulp-util'),
path = require('path'),
package = require('./bower'),
build = 'dist/',
banner = [
'/*',
' <%= package.name %> v<%= package.version %>',
' <%= package.homepage %>',
'*/',
''
].join('\n');
gulp.task('test', function () {
return gulp.src([
'bower_components/angular/angular.js',
'bower_components/angular-mocks/angular-mocks.js',
'src/angular-youtube-embed.js',
'test/unit/**/*.coffee'
])
.pipe(karma({
configFile: 'test/config/karma.conf.coffee',
action: 'watch'
}));
});
gulp.task('gh', function () {
gulp.src('src/**/*')
.pipe(gulp.dest('gh-pages'));
});
gulp.task('dist', function () {
gulp.src('src/angular-youtube-embed.js')
.pipe(uglify())
.pipe(rename(function (path) {
path.basename += '.min';
}))
.pipe(header(banner, {package: package}))
.pipe(gulp.dest(build));
});
gulp.task('host', function () {
var
app = express(),
port = 8888;
app.use(express.static(path.resolve('src/')));
app.listen(port, function() {
gutil.log('Listening on', port);
});
});
gulp.task('default', ['dist', 'host', 'test']);