-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
30 lines (27 loc) · 931 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
var gulp = require('gulp');
var uglify = require('gulp-uglify');
var react = require('gulp-react');
var replace = require('gulp-replace');
var concat = require('gulp-concat');
// Build the version located at /dist/react-backbone-app-store.min.js
// that can be used globally or through bower
gulp.task('build-global', function() {
gulp.src('src/*.js')
.pipe(react())
.pipe(replace(
'module.exports = AppStore',
'window.AppStore = AppStore'
))
.pipe(replace("var React = require('react');", ''))
.pipe(replace("var _ = require('lodash');", ''))
.pipe(replace("var $ = require('jquery')", ''))
.pipe(concat('react-backbone-app-store.js'))
.pipe(gulp.dest('dist'))
.pipe(uglify())
.pipe(concat('react-backbone-app-store.min.js'))
.pipe(gulp.dest('dist'));
});
gulp.task('watch', function() {
gulp.watch('src/*.js', ['build-global']);
});
gulp.task('default', ['watch']);