-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
46 lines (40 loc) · 1.04 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
var gulp = require('gulp');
var sass = require('gulp-sass');
var watch = require('gulp-watch');
var concat = require('gulp-concat');
var ngTemplate = require('gulp-ng-template');
gulp.task('default', function() {
// place code for your default task here
});
gulp.task('sass', sassFunc);
gulp.task('watch', watchFunc);
gulp.task('templates', templatesFunc)
gulp.task('concat', ['templates'], concatFunc);
function sassFunc() {
gulp.src('app/**/*.scss')
.pipe(sass())
.pipe(gulp.dest('css'));
}
function watchFunc() {
sassFunc();
concatFunc();
templatesFunc();
watch('app/**/*.scss', sassFunc);
watch('app/**/*.js', concatFunc);
watch('app/**/*.html', templatesFunc);
}
function templatesFunc() {
gulp.src('app/**/*.html')
.pipe(ngTemplate({
moduleName: 'app.templates',
standalone: true,
filePath: 'templates.js',
prefix: 'app/'
}))
.pipe(gulp.dest('js'));
}
function concatFunc() {
gulp.src(['js/templates.js', 'app/**/*.module.js', '!app/**/tests/*.js', 'app/**/*.js'])
.pipe(concat('all.js'))
.pipe(gulp.dest('js'));
}