-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
36 lines (31 loc) · 896 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
33
34
35
36
const gulp = require('gulp');
const babel = require('gulp-babel');
const uglify = require('gulp-uglify');
const rename = require('gulp-rename');
const babelConfig = {
presets: ['env'],
plugins: ['transform-es2015-modules-umd'],
compact: false,
};
gulp.task(
'library',
() => gulp.src('src/parseBrowser.js')
.pipe(babel(babelConfig))
.pipe(gulp.dest('build/'))
.pipe(uglify())
.pipe(rename('parseBrowser.min.js'))
.pipe(gulp.dest('build/')),
);
gulp.task(
'gh-pages-common',
() => gulp.src([
'src/gh-pages.js',
'src/parseBrowser.js',
'test/testData.js',
])
.pipe(babel(babelConfig))
.pipe(uglify())
.pipe(gulp.dest('gh-pages/')),
);
gulp.task('build', gulp.series('library', 'gh-pages-common', done => done()));
gulp.task('default', gulp.series('build', done => done()));