-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgulpfile.js
More file actions
55 lines (48 loc) · 1.52 KB
/
Copy pathgulpfile.js
File metadata and controls
55 lines (48 loc) · 1.52 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
46
47
48
49
50
51
52
53
54
55
var gulp = require('gulp');
var jshint = require('gulp-jshint');
var ngAnnotate = require('gulp-ng-annotate');
var karma = require('karma').server;
var uglify = require('gulp-uglify');
var concat = require('gulp-concat');
var rename = require('gulp-rename');
var util = require('gulp-util');
gulp.task('test', function (done) {
karma.start({
configFile: __dirname + '/karma.conf.js',
singleRun: true
}, done);
});
gulp.task('lint', function () {
return gulp.src(['./public/app/**/*.js',
'./public/app/app.js',
//'./public/js/*.js', //jshint no likey the uglified files
'./server/**/*.js',
'./*.js'
])
.pipe(jshint())
.pipe(jshint.reporter('default'));
});
gulp.task('minify', function () {
return gulp.src(['./public/app/**/*.js',
'./public/app/*.js',
'./public/js/appReady.js',
'./public/js/socketTest.js'
])
.pipe(ngAnnotate())
.pipe(concat('all.js'))
.pipe(gulp.dest('./public/js'))
.pipe(rename('all_min.js'))
.pipe(uglify({mangle: false}).on('error', util.log)) //need to figure out why this breaks the code
.pipe(gulp.dest('./public/js'));
});
//gulp.task('ngAnnotate', function () {
// return gulp.src('./public/app/app.js')
// .pipe(ngAnnotate())
// .pipe(gulp.dest('dist'));
//});
//gulp.task('default', ['lint', 'minify', 'test']);
gulp.task('default', ['lint', 'minify']);
//gulp.task('default', function () {
// gulp.run('lint');
// gulp.run('minify');
//});