-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.babel.js
61 lines (53 loc) · 2.01 KB
/
gulpfile.babel.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
import gulp from 'gulp';
import runSequence from 'run-sequence';
import gulpLoadPlugins from 'gulp-load-plugins';
import del from 'del';
import path from 'path';
import BUILD_CONFIG from './build/build-config';
/* ********************************** */
/* Common Targets */
/* ********************************** */
import webpackDevServerTask from './build/gulp/client-tasks/webpack-dev-task';
import webpackBuildTask from './build/gulp/client-tasks/webpack-build-task';
import serverStartTask from './build/gulp/server-tasks/server-start-task';
import serverWatchTask from './build/gulp/server-tasks/server-watch-task';
// Load all the gulp plugins defined in package.json
const GULP_PLUGINS = gulpLoadPlugins();
const BUILD_ROOT = path.resolve(__dirname, '_dist');
global.isProd = false;
/* ********************************** */
/* Task Rollups */
/* ********************************** */
gulp.task('dev', () => {
runSequence('dev:server', 'dev:ui');
});
gulp.task('build', ['clean'], () => {
runSequence('build:ui');
});
gulp.task('build:ui', ['clean'], (cb) => {
runSequence('build:ui:querytool', cb);
});
gulp.task('clean', [], () => del([BUILD_ROOT]));
gulp.task('default', () => GULP_PLUGINS.taskListing.withFilters(null, 'default')());
/* ********************************** */
/* Scorecards Targets */
/* ********************************** */
gulp.task('dev:ui',
webpackDevServerTask(gulp, GULP_PLUGINS, {
targetApp: BUILD_CONFIG.UI
}));
gulp.task('build:ui:querytool',
webpackBuildTask(gulp, GULP_PLUGINS, {
targetApp: BUILD_CONFIG.UI
}));
/* ********************************** */
/* API Server Targets */
/* ********************************** */
gulp.task('dev:server', ['server:start'],
serverWatchTask(gulp, GULP_PLUGINS, {
targetApp: BUILD_CONFIG.SERVER
}));
gulp.task('server:start',
serverStartTask(gulp, GULP_PLUGINS, {
targetApp: BUILD_CONFIG.SERVER
}));