-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
33 lines (26 loc) · 822 Bytes
/
gulpfile.js
File metadata and controls
33 lines (26 loc) · 822 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
32
33
/**
* @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');
gulp.task('babel', function () {
return gulp.src('src/**/*.js')
.pipe(babel(babelOptions))
.pipe(babelHelpers('babelHelpers.js', 'umd'))
.pipe(gulp.dest('dist'));
});
gulp.task('stylus', function () {
return gulp.src('src/**/*.styl').pipe(gulp.dest('lib'));
});
gulp.task('build', ['babel', 'stylus']);
gulp.task('clean', function () {
return gulp
.src('lib', {read: false})
.pipe(clean());
});
gulp.task('rebuild', ['clean', 'build']);
gulp.task('default', ['build']);