forked from streamaserver/streama-video-player
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
71 lines (56 loc) · 1.94 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'),
uglify = require('gulp-uglify'),
rename = require('gulp-rename'),
concat = require('gulp-concat'),
notify = require('gulp-notify'),
cache = require('gulp-cache'),
cssnano = require('gulp-cssnano'),
del = require('del'),
livereload = require('gulp-livereload'),
templateCache = require('gulp-angular-templatecache');
gulp.task('default', ['clean'], function() {
gulp.start('templateCache', 'scripts', 'styles', 'icomoon');
});
gulp.task('styles', function() {
return gulp.src('src/css/streama-video-player.css')
.pipe(gulp.dest('dist'))
.pipe(rename({suffix: '.min'}))
.pipe(cssnano())
.pipe(gulp.dest('dist'))
.pipe(notify({ message: 'Styles task complete' }));
});
gulp.task('icomoon', function() {
return gulp.src('src/css/icomoon/**')
.pipe(gulp.dest('dist/icomoon'))
.pipe(notify({ message: 'icomoon task complete' }));
});
gulp.task('templateCache', function() {
return gulp.src('src/templates/**/*.html')
.pipe(templateCache('streama-video-player.tpls.js', {module: 'streama.videoPlayer'}))
.pipe(gulp.dest('src/scripts'))
.pipe(notify({ message: 'Template Cache is finished' }));
});
gulp.task('scripts', function() {
return gulp.src(['src/scripts/**/*.js', 'src/scripts/streama-video-player.tpls.js' ])
.pipe(concat('streama-video-player.js'))
.pipe(gulp.dest('dist'))
.pipe(rename({suffix: '.min'}))
.pipe(uglify())
.pipe(gulp.dest('dist'))
.pipe(notify({ message: 'Scripts task complete' }));
});
gulp.task('clean', function() {
return del(['dist/styles', 'dist/scripts', 'dist/images']);
});
// Watch
gulp.task('watch', function() {
// Watch .scss files
gulp.watch('src/css/**/*.css', ['styles']);
gulp.watch('src/templates/**/*.html', ['templateCache']);
// Watch .js files
gulp.watch('src/scripts/**/*.js', ['scripts']);
// Create LiveReload server
livereload.listen();
// Watch any files in dist/, reload on change
gulp.watch(['dist/**']).on('change', livereload.changed);
});