-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGulpfile.js
70 lines (64 loc) · 1.55 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/**
* Gulpfile
*
* @type minify the files
* @author (Shreyansh Nahata <shreyans4nahata@gmailcom>)
* @date 02/04/2016
*
*/
var gulp = require('gulp');
var connect = require('gulp-connect');
var jshint = require('gulp-jshint');
var uglify = require('gulp-uglify');
var minifyCSS = require('gulp-minify-css');
var clean = require('gulp-clean');
var runSequence = require('run-sequence');
var concat = require('gulp-concat');
var ngAnnotate = require('gulp-ng-annotate');
/*
gulp.task('lint', function() {
gulp.src(['./public/javascripts/*.js'])
.pipe(jshint())
.pipe(jshint.reporter('default'))
.pipe(jshint.reporter('fail'));
});
*/
gulp.task('clean', function() {
gulp.src('.public/dist/*')
.pipe(clean({force: true}));
});
gulp.task('minify-css', function() {
var opts = {comments:true,spare:true};
gulp.src(['./public/stylesheets/*.css'])
.pipe(minifyCSS(opts))
.pipe(gulp.dest('public/dist/'))
});
gulp.task('minify-js', function() {
gulp.src(['./public/src/*.js','./public/src/**/*.js','./public/src/user/**/*.js'])
.pipe(concat('app.js'))
.pipe(ngAnnotate())
.pipe(uglify())
.pipe(gulp.dest('public/dist/'))
});
gulp.task('copy-ejs-files', function () {
gulp.src('./views/*.ejs')
.pipe(gulp.dest('public/dist/'));
});
/*
gulp.task('connect', function () {
connect.server({
root: 'app/',
port: 8888
});
});
*/
/*gulp.task('default',
['lint']
);
*/
gulp.task('default', function() {
runSequence(
['clean'],
[/*'lint',*/ 'minify-css', 'minify-js', 'copy-ejs-files']
);
});