-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgulpfile.js
41 lines (36 loc) · 1.03 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
var gulp = require('gulp'),
watch = require('gulp-watch'),
notify = require('gulp-notify'),
sourcemaps = require('gulp-sourcemaps'),
less = require('gulp-less'),
minifyCSS = require('gulp-minify-css'),
react = require('gulp-react'),
bower = require('gulp-bower');
gulp.task('bower', function() {
return bower()
.pipe(notify("Bower dependencies installed"));
});
gulp.task('react', function() {
gulp.src('./demo/jsx/*.jsx')
.pipe(react()).on('error',function(e){
this.end();
})
.pipe(gulp.dest('./demo/js/'))
.pipe(notify("JSX compiled"));
});
gulp.task('less', function() {
gulp.src('./demo/less/main.less')
.pipe(sourcemaps.init())
.pipe(less()).on('error',function(e){
this.end();
})
.pipe(minifyCSS())
.pipe(sourcemaps.write())
.pipe(gulp.dest('./demo/css'))
.pipe(notify("LESS compiled"));
});
gulp.task('watch', function () {
gulp.watch('./demo/less/*.less', ['less']);
gulp.watch('./demo/jsx/*.jsx', ['react']);
});
gulp.task('default',['bower','react','less']);