-
Notifications
You must be signed in to change notification settings - Fork 2
/
gulpfile.js
37 lines (33 loc) · 932 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
37
/**
* @file 用于发布之前compile
* @author houyl@jingoal.com
*/
/* eslint-disable*/
const gulp = require('gulp');
const clean = require('gulp-clean');
const babel = require('gulp-babel');
gulp.task('clean', () =>
gulp.src(['./lib'], {read: false})
.pipe(clean())
)
gulp.task('babel', ['clean'], () =>
gulp.src(['./src/**/*.jsx',
'./src/**/*.js'])
.pipe(babel({
presets: ['react', 'es2015', 'stage-0'],
plugins: ['transform-runtime', 'transform-decorators-legacy']
}))
.pipe(gulp.dest('./lib'))
)
gulp.task('move', ['babel'], () =>
gulp.src(['./src/**/*.scss',
'./src/**/*.css',
'./src/**/*.png',
'./src/**/*.eot',
'./src/**/*.svg',
'./src/**/*.ttf',
'./src/**/*.woff',
'./src/**/*.json'])
.pipe(gulp.dest('./lib'))
)
gulp.task('default', ['move'])