-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
98 lines (87 loc) · 2.33 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
var gulp = require("gulp"),
nodemon = require("gulp-nodemon"),
mocha = require("gulp-mocha"),
concat = require("gulp-concat"),
htmlMin = require("gulp-minify-html"),
cssMin = require("gulp-minify-css"),
imageMin = require("gulp-imagemin"),
uglify = require("gulp-uglify"),
rename = require("gulp-rename"),
wiredep = require("wiredep").stream;
gulp.task("nodemon", function() {
nodemon({
script: "server/server.js",
ext: "js"
})
});
gulp.task("combineApp", function() {
return gulp.src([
"client/app/*.module.js",
"client/app/*.js"
])
.pipe(concat("myApp.js"))
.pipe(uglify())
.pipe(rename({
suffix: ".min"
}))
.pipe(gulp.dest("server/public"));
});
gulp.task("test", function() {
return gulp.src("client/js/test.js").pipe(mocha());
});
gulp.task("smashVendors", function() {
return gulp.src([
"client/bower_components/angular/angular.min.js",
"client/bower_components/angular-route/angular-route.min.js",
"client/bower_components/jquery/dist/jquery.min.js",
"client/bower_components/bootstrap/dist/js/bootstrap.min.js"
]).pipe(concat("vendor.min.js")).pipe(gulp.dest("server/public"));
});
gulp.task("compressJS", function() {
return gulp.src("client/js/*.js")
.pipe(uglify())
.pipe(rename({
suffix: ".min"
}))
.pipe(gulp.dest("server/public"));
});
gulp.task("compressHTML", function() {
return gulp.src([
"client/views/*.html",
"client/app/go/*.html"
])
.pipe(htmlMin())
.pipe(rename({
suffix: ".min"
}))
.pipe(gulp.dest("server/public"));
});
gulp.task("compressCSS", function() {
return gulp.src("client/views/*.css")
.pipe(cssMin())
.pipe(rename({
suffix:".min"
}))
.pipe(gulp.dest("client/views/"));
});
gulp.task("smashCSS", function() {
return gulp.src([
"client/bower_components/bootstrap/dist/css/bootstrap.min.css",
"client/views/default.min.css",
"client/bower_components/animate.css/animate.min.css"
])
.pipe(concat("all.css"))
.pipe(rename({
suffix: ".min"
}))
.pipe(gulp.dest("server/public"));
});
gulp.task("watchjs", function() {
gulp.watch("*.js", ["test"]);
});
gulp.task("bower", function() {
gulp.src("./views/*.html")
.pipe(wiredep())
.pipe(gulp.dest("./views/"));
});
gulp.task("default", ["nodemon", "watchjs"]);