-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
70 lines (63 loc) · 1.91 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
var gulp = require("gulp");
var watch = require('gulp-watch');
var rename = require("gulp-rename");
var concat = require("gulp-concat");
var concatCss = require("gulp-concat-css");
var modifyCssUrls = require("gulp-modify-css-urls");
var templateCache = require("gulp-angular-templatecache");
var runSequence = require("run-sequence");
var basename = require("path").basename;
gulp.task("default", function(done) {
runSequence("style", "fonts", "html", "app", done);
});
gulp.task("style", function() {
var files = [
"./app/style/uikit.css",
"./app/**/*.css"
];
return gulp.src(files)
.pipe(concatCss("style.css"))
.pipe(modifyCssUrls({
modify: function (url, filePath) {
return "../fonts/" + basename(url);
}
}))
.pipe(gulp.dest("./css"));
});
gulp.task("fonts", function() {
return gulp.src("./bower_components/**/fonts/*.{ttf,woff,eof,eot,svg,htc}")
.pipe(rename({dirname: ''}))
.pipe(gulp.dest("./fonts"));
});
gulp.task("html", function() {
return gulp.src("./app/**/*.html")
.pipe(templateCache({root: "app/", module: "app"}))
.pipe(gulp.dest("app"));
});
gulp.task("app", function() {
return gulp.src([
"./bower_components/jquery/dist/jquery.min.js",
"./bower_components/angular/angular.min.js",
"./bower_components/angular-ui-router/release/angular-ui-router.min.js",
"./app/app.js",
"./app/templates.js",
"./app/**/*.js"
])
.pipe(concat("app.js"))
.pipe(gulp.dest("./js"));
});
gulp.task("watch", function() {
var files = [
"app/**/*.js",
"app/**/*.css",
"app/**/*.scss",
"app/**/*.html",
"!app/templates.js"
];
return gulp.watch(files, function() {
gulp.start("default");
setTimeout(function() {
gulp.start("default");
}, 2000);
});
});