-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
31 lines (25 loc) · 796 Bytes
/
gulpfile.js
File metadata and controls
31 lines (25 loc) · 796 Bytes
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
/**
* @file gulpfile
* @author leon <ludafa@outlook.com>
*/
const gulp = require('gulp');
const babel = require('gulp-babel');
const clean = require('gulp-clean');
const babelOptions = require('./package.json').babelBuild || {};
const babelHelpers = require('gulp-babel-external-helpers');
const sourcemaps = require('gulp-sourcemaps');
gulp.task('babel', function () {
return gulp.src('src/**/*.js')
.pipe(sourcemaps.init())
.pipe(babel(babelOptions))
.pipe(babelHelpers('babelHelpers.js', 'umd'))
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('lib'));
});
gulp.task('build', ['babel']);
gulp.task('clean', function () {
return gulp
.src('dist', {read: false})
.pipe(clean());
});
gulp.task('rebuild', ['clean', 'build']);