-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathgulpfile.js
52 lines (42 loc) · 1.04 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
/**
* Created by Oakley Hall on 6/16/15.
*/
'use strict';
var gulp = require('gulp');
var browserify = require('browserify');
var babelify = require('babelify');
var babel = require('gulp-babel');
var source = require('vinyl-source-stream');
var del = require('del');
gulp.task('build', ['clean', 'app', 'templates']);
gulp.task('clean', function (cb) {
del([ 'dist/bundle.js'], cb);
});
gulp.task('templates', function () {
return gulp.src('templates/*.*')
.pipe(gulp.dest('dist'));
});
gulp.task('styles', function () {
return gulp.src('src/styles/**/*.*')
.pipe(gulp.dest('dist'));
});
gulp.task('lib', function () {
return gulp.src('src/**/*.jsx')
.pipe(babel())
.pipe(gulp.dest('lib'));
});
gulp.task('app', function () {
browserify({
entries: 'src/index.jsx',
extensions: ['.jsx'],
debug: true
})
.transform(babelify)
.bundle()
.pipe(source('bundle.js'))
.pipe(gulp.dest('dist'));
});
gulp.task('watch', ['build'], function() {
gulp.watch('src/**/*.*', ['build']);
});
gulp.task('default', ['watch']);