-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
56 lines (51 loc) · 1.39 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
var gulp = require("gulp");
var wiredep = require("wiredep").stream;
var $ = require("gulp-load-plugins")();
var es = require("event-stream");
gulp.task("styles", function() {
return gulp
.src("./stylesheets/*.scss")
.pipe($.sass().on("error", handleError))
.pipe(gulp.dest("./stylesheets"));
});
gulp.task("wiredep", function() {
return gulp
.src("./index.html")
.pipe(wiredep())
.pipe(gulp.dest("."));
});
gulp.task(
"default",
gulp.series(["styles", "wiredep"], function() {
var sourcesJs = gulp
.src(["./javascripts/**/*.js"])
.pipe($.angularFilesort())
.pipe($.debug({ title: "DEBUG:" }));
var sourcesCss = gulp
.src(["./stylesheets/*.css"], { read: false })
.pipe($.debug({ title: "DEBUG:" }));
return gulp
.src("./index.html")
.pipe($.inject(es.merge(sourcesJs, sourcesCss), { addRootSlash: false }))
.pipe(gulp.dest("."));
})
);
gulp.task(
"watch",
gulp.series(["styles"], function() {
gulp.watch("stylesheets/*.scss", ["default"]);
gulp.watch("javascripts/**/*.js", ["default"]);
gulp.watch("bower.json", ["default"]);
})
);
gulp.task("buildposts", function() {
return gulp
.src("posts/**/*.md")
.pipe($.debug({ title: "DEBUG:" }))
.pipe($.markdown())
.pipe(gulp.dest("digested_posts"));
});
function handleError(err) {
console.error(err.toString());
this.emit("end");
}