2015-05-03 23:04:51 +00:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
var gulp = require('gulp');
|
2015-05-07 20:53:46 +00:00
|
|
|
var nodemon = require('gulp-nodemon');
|
2015-05-09 20:19:25 +00:00
|
|
|
var less = require('gulp-less');
|
2015-05-03 23:04:51 +00:00
|
|
|
var gulpReactJade = require('gulp-react-jade-amd');
|
2015-05-09 20:19:25 +00:00
|
|
|
var mainBowerFiles = require('main-bower-files');
|
2015-05-03 23:04:51 +00:00
|
|
|
|
|
|
|
gulp.task('react-jade', function() {
|
|
|
|
return gulp.src('static/js/**/*.jade')
|
|
|
|
.pipe(gulpReactJade())
|
|
|
|
.pipe(gulp.dest('static/js/templates'));
|
|
|
|
});
|
2015-05-07 20:53:46 +00:00
|
|
|
|
2015-05-09 20:19:25 +00:00
|
|
|
gulp.task('less', function () {
|
|
|
|
return gulp.src('static/css/index.less')
|
|
|
|
.pipe(less('index.css'))
|
|
|
|
.pipe(gulp.dest('./static/css'));
|
|
|
|
});
|
|
|
|
|
|
|
|
gulp.task('fonts', function() {
|
|
|
|
return gulp.src(mainBowerFiles({filter: /.*fonts.*/i}))
|
|
|
|
.pipe(gulp.dest('static/fonts/'));
|
|
|
|
});
|
|
|
|
|
2015-05-07 20:53:46 +00:00
|
|
|
gulp.task('develop', function() {
|
|
|
|
gulp.watch('static/js/app/**/*.jade', ['react-jade']);
|
2015-05-09 20:19:25 +00:00
|
|
|
gulp.watch('static/css/**/*.less', ['less']);
|
2015-05-07 20:53:46 +00:00
|
|
|
|
|
|
|
return nodemon({
|
|
|
|
ignore: ['static/**/*.js', 'app/**/*.js', 'node_modules/**'],
|
|
|
|
script: 'app.js',
|
|
|
|
ext: 'js'
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
gulp.task('default', [
|
|
|
|
'react-jade',
|
2015-05-09 20:19:25 +00:00
|
|
|
'less',
|
|
|
|
'fonts',
|
2015-05-07 20:53:46 +00:00
|
|
|
'develop'
|
|
|
|
]);
|