-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.babel.js
63 lines (55 loc) · 1.19 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
62
63
'use strict';
/** globals */
import gulp from 'gulp';
import os from 'os';
import pkg from './package.json';
/** plug-ins */
import addSrc from 'gulp-add-src';
import babel from 'gulp-babel';
import clean from 'gulp-clean';
import concat from 'gulp-concat';
import jshint from 'gulp-jshint';
import plumber from 'gulp-plumber';
import sourcemaps from 'gulp-sourcemaps';
import uglify from 'gulp-uglify';
/** dependencies */
import pump from 'pump';
import rename from 'gulp-rename';
var options = {
browsers: [
'last 4 version',
]
};
gulp.task('clean', () => {
return gulp.src([
'french-dip.min.js'
], {
read: false
})
.pipe(clean());
});
gulp.task('uglify:demo', (cb) => {
pump([
gulp.src('./demo/scripts/demo-es2015.js'),
babel({
presets: ['es2015']
}),
rename('demo.js'),
gulp.dest('./demo/scripts')
], cb);
});
gulp.task('uglify:french-dip', (cb) => {
pump([
gulp.src('french-dip.js'),
babel({
presets: ['es2015-ie']
}),
rename('french-dip.min.js'),
gulp.dest('.')
], cb);
});
gulp.task('default', [
'clean',
'uglify:demo',
'uglify:french-dip'
]);