This repository has been archived by the owner on Jan 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpfile.js
59 lines (52 loc) · 1.41 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
/**
* SINGLE MACHINE - gulpfile.js
* (c) 2018
*/
var gulp = require('gulp');
var uglify = require('gulp-uglify');
var concat = require('gulp-concat');
var minifyCss = require('gulp-clean-css');
var ngAnnotate = require('gulp-ng-annotate');
var decomment = require('gulp-decomment');
var minifyejs = require('gulp-minify-ejs');
var removeHtmlComments = require('gulp-remove-html-comments');
gulp.task('minify-css', function(){
return gulp.src('app/stylesheets/*.css')
.pipe(minifyCss())
.pipe(concat('main.css'))
//.pipe(decomment({trim: true}))
.pipe(gulp.dest('app/assets'), {overwrite: true});
});
gulp.task('minify-js', function(){
return gulp.src([
'app/app.js',
'app/directives/*.js',
'app/factory/*.js',
'app/services/*.js',
'app/components/*.js',
'app/controllers/*.js'
])
.pipe(concat('main.js'))
.pipe(decomment({trim: true}))
.pipe(ngAnnotate())
.pipe(uglify())
.pipe(gulp.dest('app/assets'), {overwrite: true});
});
gulp.task('minify-ejs', function(){
return gulp.src([
'app/main.ejs'
])
.pipe(minifyejs())
.pipe(removeHtmlComments())
.pipe(gulp.dest('app/assets'), {overwrite: true});
});
gulp.task('default',
gulp.series(
'minify-css',
'minify-js',
'minify-ejs',
function(done) {
done();
})
);
// EOF