forked from CommandersAct/react-tag-commander
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
49 lines (45 loc) · 1.11 KB
/
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
40
41
42
43
44
45
46
47
48
49
const { src, dest, series } = require('gulp');
const minify = require('gulp-minify');
const babel = require('gulp-babel');
const concat = require('gulp-concat');
const babelConfig = require('./babel.config.json');
function scripts(cb) {
src('./lib/*.js')
.pipe(dest('./dist/'));
cb();
}
function buildEs5(cb) {
console.log("building es5 lib");
// converting to ES5
src('src/*.js')
.pipe(babel(babelConfig))
.pipe(minify({
ext:{
min:'.es5.min.js'
},
exclude: ['tasks'],
noSource: true
}))
.pipe(concat('index.es5.min.js'))
.pipe(dest('dist'));
cb();
}
function buildEs6(cb) {
console.log("building es6 lib");
// converting to ES5
src('src/*.js')
.pipe(minify({
ext:{
min:'.es6.min.js'
},
exclude: ['tasks'],
noSource: true
}))
.pipe(concat('index.es6.min.js'))
.pipe(dest('dist'));
cb();
}
exports.scripts = scripts;
exports.buildEs5 = buildEs5;
exports.buildEs6 = buildEs6;
exports.default = series(scripts, buildEs5, buildEs6);