-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgulpfile.js
42 lines (34 loc) · 1.02 KB
/
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
37
38
39
40
41
42
/**
* @file gulpfile
* @author leon <ludafa@outlook.com>
*/
/* eslint-disable fecs-no-require */
const gulp = require('gulp');
const babel = require('gulp-babel');
const babelHelpers = require('gulp-babel-external-helpers');
const sourcemaps = require('gulp-sourcemaps');
const stylus = require('gulp-stylus');
const nib = require('nib');
gulp.task('babel', function () {
return gulp.src('src/**/*.js')
.pipe(sourcemaps.init())
.pipe(babel())
.pipe(babelHelpers('babelHelpers.js', 'umd'))
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('lib'));
});
gulp.task('css', function () {
return gulp.src(['src/**/*.styl', '!src/component/func.styl'])
.pipe(
stylus({
compress: false,
use: [nib()]
})
)
.pipe(gulp.dest('lib'));
});
gulp.task('stylus', function () {
return gulp.src('src/**/*.styl').pipe(gulp.dest('lib'));
});
gulp.task('build', ['babel', 'css', 'stylus']);
gulp.task('default', ['build']);