-
Notifications
You must be signed in to change notification settings - Fork 54
/
Copy pathgulpfile.js
81 lines (72 loc) · 2.08 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
const path = require("path");
const autoprefixer = require("autoprefixer");
const gulp = require("gulp");
const postcss = require("gulp-postcss");
const rename = require("gulp-rename");
const bundle = require("./scripts/bundle.js");
const css = require("./scripts/css.js");
const icons = require("./scripts/icons.js");
// const pkg = require("./package.json");
// Clean output directories
gulp.task("clean", () => null);
// Build bundle files
gulp.task("build:bundle", () => {
return gulp.src("config/bundle.json")
.pipe(bundle({
cwd: __dirname,
}))
.pipe(gulp.dest("dist/"));
});
// Build components
gulp.task("build:components", () => {
return null;
});
// Build icons fonts
gulp.task("build:icons", () => {
return gulp.src("config/icons.json")
.pipe(icons({
cwd: __dirname,
iconsFolder: path.join(__dirname, "icons"),
}))
.pipe(gulp.dest("dist/"));
});
// Generate css files
gulp.task("build:css", () => {
return gulp.src("siimple.config.scss")
.pipe(css.compile({
loadPaths: [__dirname],
}))
.pipe(postcss([autoprefixer()]))
.pipe(rename("siimple.css"))
.pipe(gulp.dest("dist/"))
.pipe(css.minify({
"compatibility": "*",
"level": 2,
}))
.pipe(rename("siimple.min.css"))
.pipe(gulp.dest("dist/"));
});
// Build documentaation styles
gulp.task("docs:styles", () => {
return gulp.src("src/styles.scss")
.pipe(css.compile({
includePaths: [
__dirname,
]
}))
.pipe(postcss([autoprefixer()]))
.pipe(css.minify({
"compatibility": "*",
"level": 2,
}))
.pipe(rename("siimple.min.css"))
.pipe(gulp.dest("public/static/"));
});
// Copy documentation fonts
gulp.task("docs:fonts", () => {
return gulp.src("dist/fonts/*").pipe(gulp.dest("public/static/fonts/"));
});
// Copy documentation assets
gulp.task("docs:assets", () => {
return gulp.src("src/assets/*").pipe(gulp.dest("public/"));
});