-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
45 lines (38 loc) · 1.06 KB
/
gulpfile.js
File metadata and controls
45 lines (38 loc) · 1.06 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
42
43
44
45
var gulp = require( 'gulp' );
var connect = require( 'gulp-connect' );
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var ngAnnotate = require('gulp-ng-annotate')
var files = [ '*.*', 'pages/**/**'];
gulp.task( 'files', function() {
gulp.src( files ).pipe( connect.reload() );
});
gulp.task('minify', function() {
gulp.src(['./app.js',
'pages/**/*.module.js',
'pages/**/*.service.js',
'pages/**/*.factory.js',
'pages/**/*.directive.js',
'pages/**/*.controller.js',
'pages/**/*.js'])
.pipe(concat('app.min.js'))
.pipe(ngAnnotate())
.pipe(uglify())
.pipe(gulp.dest('./'))
});
gulp.task( 'watch', function() {
gulp.watch( files, ['files']);
gulp.watch( ['./app.js', 'pages/**/*.js'], ['minify'])
});
gulp.task( 'connect', function() {
connect.server({
livereload: true,
port: '8443',
host: 'localhost',
directoryListing: false,
fallback: 'index.html',
open: true,
});
});
gulp.task( 'serve', [ 'connect', 'minify', 'watch' ]);
gulp.task( 'default', ['minify']);