-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgulpfile.js
86 lines (78 loc) · 2.58 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
var gulp = require("gulp");
var gutil = require("gulp-util");
var minifyHtml = require("gulp-minify-html");
var ngHtml2Js = require("gulp-ng-html2js");
var concat = require("gulp-concat");
var uglify = require("gulp-uglify");
var styl = require('gulp-styl');
var watch = require('gulp-watch');
var angularPartials = "./angularPartials/**/*.html";
var scripts = "./public/scripts/**/*.js";
var styles = "./public/style/**/*.css";
var bowerScripts = [
"./bower_components/angular/angular.min.js",
"./bower_components/angular-moment/angular-moment.min.js",
"./bower_components/angular-resource/angular-resource.min.js",
"./bower_components/angular-route/angular-route.min.js",
"./bower_components/moment/min/moment.min.js",
"./bower_components/angular-local-storage/angular-local-storage.min.js",
//"./bower_components/ng-table/ng-table.js",
"./bower_components/angular-base64/angular-base64.min.js",
"./bower_components/d3/d3.min.js",
"./bower_components/nvd3/nv.d3.min.js",
"./bower_components/angularjs-nvd3-directives/dist/angularjs-nvd3-directives.js"
];
bowerStyles = [
"./bower_components/nvd3/nv.d3.min.css"
];
gulp.task("angular", function () {
gulp.src(angularPartials)
.pipe(minifyHtml({
empty: true,
spare: true,
quotes: true
}))
.pipe(ngHtml2Js({
moduleName: "PlexWWWatchPartials",
prefix: "partials/"
}))
.pipe(concat("partials.min.js"))
//.pipe(uglify())
.pipe(gulp.dest("public/build"));
});
gulp.task("scripts", function(){
gulp.src(scripts)
.pipe(concat("script.js"))
//.pipe(uglify())
.pipe(gulp.dest("public/build"));
});
gulp.task("styles", function() {
gulp.src(styles)
/*.pipe(styl({
compress : true
}))*/
.pipe(concat("style.css"))
.pipe(gulp.dest("public/build"));
});
gulp.task("bower", function () {
gulp.src(bowerScripts)
.pipe(concat("bower.js"))
.pipe(gulp.dest("public/build"));
gulp.src(bowerStyles)
.pipe(concat("bower.css"))
.pipe(gulp.dest("public/build"));
});
gulp.task("default", ["angular", "scripts", "styles", "bower"], function() {
gulp.watch("public/scripts/**", function (event) {
gulp.run("scripts");
});
gulp.watch("public/style/**", function (event) {
gulp.run("styles");
});
gulp.watch("angularPartials/**", function (event) {
gulp.run("angular");
});
gulp.watch("public/bower_components/**", function (event) {
gulp.run("bower");
});
});