forked from seatgeek/react-infinite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gulpfile.js
38 lines (32 loc) · 1.05 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
var gulp = require('gulp'),
yargs = require('yargs'),
given = require('gulp-if'),
jsx = require('gulp-react'),
rename = require('gulp-rename'),
concat = require('gulp-concat'),
minifyjs = require('gulp-uglify'),
sourcemaps = require('gulp-sourcemaps');
var args = require('yargs').alias('P', 'production').argv,
production = args.production,
development = !production;
gulp.task('build', function() {
gulp.src('./src/react-infinite.jsx')
.pipe(sourcemaps.init())
.pipe(jsx())
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('dist'));
});
gulp.task('buildp', function() {
gulp.src("./src/react-infinite.jsx")
.pipe(rename("react-infinite.min.jsx"))
.pipe(jsx())
.pipe(minifyjs())
.pipe(gulp.dest('dist'));
});
gulp.task('example', function() {
gulp.src(["bower_components/react/react.js", "src/react-infinite.jsx", "examples/index.jsx"])
.pipe(jsx())
.pipe(concat("bundle_scripts.js"))
.pipe(gulp.dest('examples'))
});
gulp.task('default', ['build', 'buildp']);