This repository was archived by the owner on Jan 17, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgulpfile.js
More file actions
54 lines (41 loc) · 1.27 KB
/
gulpfile.js
File metadata and controls
54 lines (41 loc) · 1.27 KB
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
var gulp = require('gulp')
var browserify = require('browserify')
var reactify = require('reactify');
var source = require('vinyl-source-stream')
var react = require('gulp-react')
var gutil = require('gulp-util')
var less = require('gulp-less')
var autoprefixer = require('gulp-autoprefixer');
var minifyCSS = require('gulp-minify-css');
var uglify = require('gulp-uglify')
var watch = require('gulp-watch')
var concat = require('gulp-concat')
var notify = require('gulp-notify')
gulp.task('less', function () {
return gulp.src('./public/less/style.less')
.pipe(less({compress: false}).on('error', gutil.log))
.pipe(minifyCSS({keepBreaks: true}))
.pipe(gulp.dest('./public/less/'))
.pipe(notify('Less Compiled Minified'));
});
gulp.task('browserify', function(){
var b = browserify();
b.transform(reactify);
b.add('./app/router.jsx');
return b.bundle()
.pipe(source('build.js'))
.pipe(gulp.dest('./public/js/'))
.pipe(notify('JSX Compiled Minified'));
});
gulp.task('watch', function() {
gulp.watch('./public/less/*.less', function() {
gulp.run('less');
});
gulp.watch('./app/**/*.jsx', function() {
gulp.run('browserify');
});
gulp.watch('./app/*.jsx', function() {
gulp.run('browserify');
});
});
gulp.task('default', ['less', 'browserify', 'watch']);