-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
41 lines (36 loc) · 1.11 KB
/
gulpfile.js
File metadata and controls
41 lines (36 loc) · 1.11 KB
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
var gulp = require('gulp'),
concat = require('gulp-concat'),
sourcemaps = require('gulp-sourcemaps'),
uglify = require('gulp-uglify'),
ngAnnotate = require('gulp-ng-annotate'),
server = require('gulp-webserver'),
rename = require('gulp-rename'),
clean = require('gulp-clean');
gulp.task('app', function(){
return gulp.src(['client/config.js', 'client/core.js', 'client/**/*.js'])
.pipe(sourcemaps.init())
.pipe(concat('app.js'))
.pipe(ngAnnotate())
.pipe(uglify())
.pipe(sourcemaps.write())
.pipe(gulp.dest('public'));
});
gulp.task('views', function(){
return gulp.src('client/**/views/*.html')
.pipe(rename({dirname:''}))
.pipe(gulp.dest('public/views'));
});
gulp.task('watch', function(){
gulp.watch('client/**/*.js', ['app']);
gulp.watch('client/**/views/*.html', ['views']);
});
gulp.task('server', function(){
gulp.src('public')
.pipe(server({
host: '0.0.0.0',
livereload: true,
directoryListing: false,
open: false
}));
})
gulp.task('default', ['app', 'views', 'watch', 'server']);