-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
55 lines (48 loc) · 1.38 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
var del = require('del');
var gulp = require('gulp');
var gulpConcat = require('gulp-concat');
var gulpJsHint = require('gulp-jshint');
var gulpNgAnnotate = require('gulp-ng-annotate');
var gulpNgHtml2Js = require('gulp-ng-html2js');
var gulpSass = require('gulp-sass');
var gulpUglify = require('gulp-uglify');
gulp.task('clean', function() {
del('public/build/**/*');
});
gulp.task('default', ['build']);
gulp.task('build', ['build:html', 'build:js', 'build:sass']);
gulp.task('build:html', function() {
gulp.src('src/**/*.html')
.pipe(gulpNgHtml2Js({
moduleName: 'nr.grocery.templates'
}))
.pipe(gulpUglify({
mangle: false
}))
.pipe(gulpConcat('app.templates.min.js'))
.pipe(gulp.dest('public/build'));
});
gulp.task('build:js', function() {
gulp.src([
'src/app/module.js',
'src/app/config.js',
'src/app/run.js',
'src/app/**/*.js'
])
.pipe(gulpNgAnnotate())
.pipe(gulpUglify({
mangle: false
}))
.pipe(gulpConcat('app.min.js'))
.pipe(gulp.dest('public/build'));
});
gulp.task('build:sass', function() {
gulp.src('src/sass/**/*.scss')
.pipe(gulpSass())
.pipe(gulp.dest('public/build'));
});
gulp.task('watch', function() {
gulp.watch('src/**/*.html', ['build:html']);
gulp.watch('src/app/**/*.js', ['build:js']);
gulp.watch('src/sass/**/*.scss', ['build:sass']);
});