forked from kennethjiang/react-percentage-circle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
69 lines (59 loc) · 1.57 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
var gulp = require('gulp');
var initGulpTasks = require('react-component-gulp-tasks');
var webpack = require('webpack-stream');
var header = require('gulp-header');
var jshint = require('gulp-jshint');
var rename = require('gulp-rename');
var react = require('gulp-react');
var streamify = require('gulp-streamify');
/**
* Tasks are added by the react-component-gulp-tasks package
*
* See https://github.com/JedWatson/react-component-gulp-tasks
* for documentation.
*
* You can also add your own additional gulp tasks if you like.
*/
var taskConfig = {
component: {
name: 'ReactPercentageCircle',
dependencies: [
'classnames',
'react',
'react-dom'
],
lib: 'lib'
},
example: {
src: 'example/src',
dist: 'example/dist',
files: [
'index.html',
'.gitignore'
],
scripts: [
'example.js'
],
less: [
'example.less'
]
}
};
initGulpTasks(gulp, taskConfig);
gulp.task('bundle-js', ['build'], function() {
var stream = gulp.src('./lib/*.js')
.pipe(streamify(header(distHeader, {
pkg: pkg,
devBuild: devBuild
})))
.pipe(webpack(require('./webpack.config.js')))
.pipe(gulp.dest('./dist'))
.pipe(rename('ReactPercentageCircle.min.js'))
.pipe(streamify(uglify()))
.pipe(streamify(header(distHeader, {
pkg: pkg,
devBuild: devBuild
})))
.pipe(gulp.dest('./dist'));
return stream;
});