-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
66 lines (57 loc) · 1.57 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
const { task, watch, src, dest, series, parallel } = require("gulp");
const math = require("gulp-mathjax-node");
const sass = require("gulp-sass")(require('sass'));
const cssmin = require("gulp-cssmin");
const pug = require("gulp-pug-3");
const gulpWatch = require("gulp-watch");
task("compilaPug", function(cb) {
src("./src/content/**/*.pug").pipe(pug()).pipe(math()).pipe(dest("dist"));
cb();
});
task("compilaSass", function(cb) {
src("./src/style/*.scss")
.pipe(sass())
.pipe(cssmin())
.pipe(dest("dist/style"));
cb();
});
task("copiarArchivos", function(cb) {
src(["./src/content/**/*", "!./src/content/**/*.pug"]).pipe(dest("dist"));
cb();
});
task("copiarUtilidades", function(cb) {
src("./src/utils/**/*").pipe(dest("dist/utils"));
cb();
});
task("watchViejo", function() {
watch("./src/content/**/*.pug", task("compilaPug"));
watch("./src/style/*.scss", task("compilaSass"));
watch(
["./src/content/**/*", "!./src/content/**/*.pug"],
task("copiarArchivos")
);
watch("./src/utils/**/*", task("copiarUtilidades"));
});
task(
"build",
parallel(
task("compilaPug"),
task("compilaSass"),
task("copiarArchivos"),
task("copiarUtilidades")
)
);
task("watch", function() {
gulpWatch("./src/content/**/*.pug")
.pipe(pug())
.pipe(math())
.pipe(dest("dist"));
gulpWatch("./src/style/*.scss")
.pipe(sass())
.pipe(cssmin())
.pipe(dest("dist/style"));
gulpWatch(["./src/content/**/*", "!./src/content/**/*.pug"]).pipe(
dest("dist")
);
gulpWatch("./src/utils/**/*").pipe(dest("dist/utils"));
});