-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathgulpfile.js
More file actions
46 lines (39 loc) · 945 Bytes
/
gulpfile.js
File metadata and controls
46 lines (39 loc) · 945 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
38
39
40
41
42
43
44
45
46
const { series, parallel, src } = require('gulp');
const { task } = require('gulp-shell');
const install = require('gulp-install');
const path = require('path');
const clientDir = path.join('.', 'TempHire');
const serverDir = path.join('.', 'Express');
// client npm install
function clientInstall() {
return src(mapPath(clientDir, ['package.json']))
.pipe(install());
}
// server npm install
function serverInstall() {
return src(mapPath(serverDir, ['package.json']))
.pipe(install());
}
// build client code
function clientBuild() {
return task(['gulp'], { cwd: clientDir })();
}
// run server
function run() {
return task('node server', { cwd: serverDir })();
}
exports.default = series(
parallel(
serverInstall,
series(
clientInstall,
clientBuild
)
),
run
);
function mapPath(dir, filenames) {
return filenames.map(function(filename) {
return path.join(dir, filename);
});
};