-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
26 lines (21 loc) · 695 Bytes
/
gulpfile.js
File metadata and controls
26 lines (21 loc) · 695 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
const gulp = require('gulp'),
babel = require('gulp-babel'),
del = require('del'),
webpack = require('webpack'),
webpackStream = require('webpack-stream'),
webpackConfig = require('./config/webpack.prod');
const buildPath = './dist';
function buildServer() {
return gulp.src('src/**/*')
.pipe(babel({ presets: ['es2015', 'stage-2'] }))
.pipe(gulp.dest(buildPath));
}
function buildClient() {
return gulp.src('client')
.pipe(webpackStream(webpackConfig), webpack)
.pipe(gulp.dest('./dist/client'));
}
function clean() {
return del([buildPath], { force: true });
}
exports.default = gulp.series(clean, buildServer, buildClient);