forked from sahat/tvshow-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
47 lines (41 loc) · 1.32 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
var gulp = require('gulp');
var sass = require('gulp-sass');
var csso = require('gulp-csso');
var ngAnnotate = require('gulp-ng-annotate');
var uglify = require('gulp-uglify');
var concat = require('gulp-concat');
var plumber = require('gulp-plumber');
var templateCache = require('gulp-angular-templatecache');
gulp.task('sass', function() {
gulp.src('public/stylesheets/style.scss')
.pipe(plumber())
.pipe(sass())
.pipe(csso())
.pipe(gulp.dest('public/stylesheets'));
});
gulp.task('compress', function() {
gulp.src([
'public/vendor/angular.js',
'public/vendor/*.js',
'public/app.js',
'public/services/*.js',
'public/controllers/*.js',
'public/filters/*.js',
'public/directives/*.js'
])
.pipe(concat('app.min.js'))
.pipe(ngAnnotate())
.pipe(uglify())
.pipe(gulp.dest('public'));
});
gulp.task('templates', function() {
gulp.src('public/views/**/*.html')
.pipe(templateCache({ root: 'views', module: 'MyApp' }))
.pipe(gulp.dest('public'));
});
gulp.task('watch', function() {
gulp.watch('public/stylesheets/*.scss', ['sass']);
gulp.watch('public/views/**/*.html', ['templates']);
gulp.watch(['public/**/*.js', '!public/app.min.js', '!public/templates.js', '!public/vendor'], ['compress']);
});
gulp.task('default', ['sass', 'compress', 'templates', 'watch']);