forked from inorganik/countUp.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
32 lines (27 loc) · 801 Bytes
/
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
const gulp = require('gulp');
const uglifyES = require('uglify-es');
const composer = require('gulp-uglify/composer');
const concat = require('gulp-concat');
const del = require('del');
const uglify = composer(uglifyES, console);
const clean = () => del(['dist/*']);
const buildNormal = () => {
return gulp.src('./dist/countUp.js')
.pipe(concat('countUp.min.js'))
.pipe(uglify())
.pipe(gulp.dest('dist'));
}
const buildLegacy = () => {
return gulp.src([
'./requestAnimationFrame.polyfill.js',
'./dist/countUp.js'
])
.pipe(concat('countUp.withPolyfill.min.js'))
.pipe(uglify())
.pipe(gulp.dest('dist'));
}
gulp.task('clean', clean);
const build = gulp.series(buildNormal, buildLegacy);
gulp.task('build', build);
exports.clean = clean;
exports.default = build;