-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathgulpfile.babel.js
40 lines (34 loc) · 953 Bytes
/
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
//2016
import concat from 'gulp-concat';
import gulp from 'gulp';
import plumber from 'gulp-plumber';
import babel from 'gulp-babel';
import addsrc from 'gulp-add-src';
const src = './src/js/';
const dist = './www';
const indexAndroid = 'index-android.js';
const polyfillsAndroid = 'polyfills-android.js';
const indexIos = 'index-ios.js';
const utils = 'utils.js';
const build = (done) => {
gulp
.src([ src + utils, src + indexIos ])
.pipe(plumber())
.pipe(babel())
.pipe(concat(indexIos))
.pipe(gulp.dest(dist));
gulp
.src([ src + utils, src + indexAndroid ])
.pipe(plumber())
.pipe(babel())
.pipe(addsrc.prepend(src + polyfillsAndroid))
.pipe(concat(indexAndroid))
.pipe(gulp.dest(dist));
done();
};
gulp.task('build', gulp.series(build));
gulp.task('watch', () => {
gulp.run(gulp.series('build'));
gulp.watch(src + '*.js', ['build']);
});
gulp.task('default', gulp.series('build'));