forked from Breeze/temphire.angular
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
39 lines (31 loc) · 925 Bytes
/
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
var gulp = require('gulp');
var shell = require('gulp-shell');
var install = require('gulp-install');
var path = require('path');
var clientDir = path.join('.', 'TempHire');
var serverDir = path.join('.', 'Express');
// client npm install
gulp.task('client-install', function() {
return gulp.src(mapPath(clientDir, ['package.json']))
.pipe(install());
});
// server npm install
gulp.task('server-install', function() {
return gulp.src(mapPath(serverDir, ['package.json']))
.pipe(install());
});
// build client code
gulp.task('client-build', ['client-install'],
shell.task(['gulp'], { cwd: clientDir })
);
// run server
gulp.task('run', ['server-install', 'client-build'],
shell.task('node server', { cwd: serverDir })
);
gulp.task('default', ['run'], function() {
});
function mapPath(dir, filenames) {
return filenames.map(function(filename) {
return path.join(dir, filename);
});
};