forked from AlexDisler/cordova-plugin-inapppurchase
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.babel.js
37 lines (32 loc) · 896 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
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 = () => {
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));
};
gulp.task('build', build);
gulp.task('watch', () => {
gulp.run(['build']);
gulp.watch(src + '*.js', ['build']);
});
gulp.task('default', ['build']);