nci/gulpfile.js

43 lines
986 B
JavaScript
Raw Permalink Normal View History

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({
2015-07-13 22:16:38 +00:00
ignore: ['static/**/*.js', 'app/**/*.js', 'node_modules/**', 'data/**'],
2015-05-07 20:53:46 +00:00
script: 'app.js',
2015-06-14 13:40:20 +00:00
ext: 'js'
2015-05-07 20:53:46 +00:00
});
});
gulp.task('default', [
'react-jade',
2015-05-09 20:19:25 +00:00
'less',
'fonts',
2015-05-07 20:53:46 +00:00
'develop'
]);