-
Notifications
You must be signed in to change notification settings - Fork 159
/
Copy pathgulpfile.js
44 lines (36 loc) · 1.26 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
const gulp = require("gulp");
const pkg = require("./package.json");
const minifyCSS = require("gulp-clean-css");
const concat = require("gulp-concat");
const header = require("gulp-header");
const size = require("gulp-size");
const stylus = require("gulp-stylus");
const comment = `/**
* Wing v${pkg.version}
* Copyright 2016-2018 Kabir Shah
* Released under the MIT License
* http://usewing.ml
*/\r\n`;
gulp.task("build", function () {
return gulp.src(["./src/config.styl", "./src/base.styl", "./src/grid.styl", "./src/typography.styl", "./src/form.styl", "./src/button.styl", "./src/link.styl", "./src/list.styl", "./src/image.styl", "./src/box.styl", "./src/nav.styl", "./src/card.styl", "./src/code.styl", "./src/divider.styl", "./src/util.styl"])
.pipe(concat("wing.styl"))
.pipe(stylus())
.pipe(header(comment + "\r\n"))
.pipe(size())
.pipe(gulp.dest("./dist/"));
});
gulp.task("minify", ["build"], function() {
return gulp.src(["./dist/wing.css"])
.pipe(minifyCSS())
.pipe(header(comment))
.pipe(size())
.pipe(size({
gzip: true
}))
.pipe(concat("wing.min.css"))
.pipe(gulp.dest("./dist/"));
});
gulp.task("watch", function() {
gulp.watch(["src/*.css"], ["default"]);
});
gulp.task("default", ["build", "minify"]);