-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
47 lines (38 loc) · 897 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
38
39
40
41
42
43
44
45
46
47
var gulp = require('gulp');
var babel = require('gulp-babel');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
gulp.task('build-index', function() {
return gulp
.src("react-es6-mixins.js")
.pipe(babel({
presets: [
"es2015"
],
plugins: [
"transform-es2015-modules-commonjs"
]
}))
.pipe(rename("index.js"))
.pipe(gulp.dest("."))
});
gulp.task('build-dist', function() {
return gulp
.src("react-es6-mixins.js")
.pipe(babel({
presets: [
"es2015"
],
plugins: [
"transform-es2015-modules-umd"
]
}))
.pipe(rename("react-es6-mixins.js"))
.pipe(gulp.dest("dist"))
.pipe(uglify({
preserveComments: false
}))
.pipe(rename("react-es6-mixins.min.js"))
.pipe(gulp.dest("dist"))
});
gulp.task('build',['build-index', 'build-dist'])