-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
71 lines (68 loc) · 2.19 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
const { src, dest, watch } = require("gulp");
const minifyCSS = require("gulp-csso");
const concatCss = require("gulp-concat-css");
const purgecss = require("gulp-purgecss");
const uglify = require("gulp-uglify");
const rename = require("gulp-rename");
const concat = require("gulp-concat");
function css() {
return src([
"node_modules/semantic-ui-css/components/reset.css",
"node_modules/semantic-ui-css/components/button.css",
"node_modules/semantic-ui-css/components/container.css",
"node_modules/semantic-ui-css/components/divider.css",
"node_modules/semantic-ui-css/components/form.css",
"node_modules/semantic-ui-css/components/grid.css",
"node_modules/semantic-ui-css/components/header.css",
"node_modules/semantic-ui-css/components/input.css",
"node_modules/semantic-ui-css/components/item.css",
"node_modules/semantic-ui-css/components/label.css",
"node_modules/semantic-ui-css/components/popup.css",
"node_modules/semantic-ui-css/components/segment.css",
"node_modules/semantic-ui-css/components/site.css",
"node_modules/semantic-ui-css/components/table.css",
"static/style.css",
])
.pipe(concatCss("bundle.css"))
.pipe(
purgecss({
whitelist: [
"no-such-page",
"blockquote",
// used for labels in emoji-summary
"label",
"pointing",
// Used in markdown, but we don't have any examples in the
// raw HTML layouts.
"h1",
"h2",
"h3",
"h4",
// Not autodetected, presumably because of our use of handlebars?
"dividing",
],
content: ["views/**/*.html"],
}),
)
.pipe(minifyCSS())
.pipe(dest("static"));
}
function js() {
return src([
"node_modules/hammerjs/hammer.js",
"./static/tapedit.js",
"./static/shortcuts.js",
])
.pipe(concat("bundle"))
.pipe(uglify())
.pipe(rename({ extname: ".min.js" }))
.pipe(dest("static"));
}
exports.default = function () {
watch(["gulpfile.js", "static/style.css"], { ignoreInitial: false }, css);
watch(
["gulpfile.js", "./static/tapedit.js", "./static/shortcuts.js"],
{ ignoreInitial: false },
js,
);
};