-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
37 lines (29 loc) · 809 Bytes
/
gulpfile.js
File metadata and controls
37 lines (29 loc) · 809 Bytes
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
const path = require('path');
const rimraf = require('rimraf');
const mkdirp = require('mkdirp');
const buildProfile = require('./scripts/profiles');
const buildMinify = require('./scripts/minify');
const {
BUILD_DIR, DATA_SRC_DIR
} = require('./scripts/constants');
async function build(cb) {
await mkdirp(path.resolve(BUILD_DIR));
await Promise.all([ buildCandidateData(), buildMinify() ])
.then(() => cb())
.catch(cb);
}
async function buildCandidateData() {
await mkdirp(path.resolve(BUILD_DIR, 'content'));
await buildProfile(path.resolve(DATA_SRC_DIR, 'profiles'),
path.resolve(BUILD_DIR, 'content/profiles.json'));
}
function clean(cb) {
rimraf(path.resolve(BUILD_DIR), err => {
cb(err);
});
}
module.exports = {
default: clean,
build: build,
clean: clean
}