2015-11-26 01:49:28 +00:00
|
|
|
var gulp = require('gulp');
|
|
|
|
var cssmin = require('gulp-cssmin');
|
|
|
|
var uglify = require('gulp-uglify');
|
|
|
|
var nodemon = require('gulp-nodemon');
|
|
|
|
var gif = require('gulp-if');
|
|
|
|
|
|
|
|
var inProduction = process.env['NODE_ENV'] == 'production';
|
|
|
|
|
2015-11-30 20:11:10 +00:00
|
|
|
gulp.task('build-assets-css', function() {
|
2015-11-26 01:49:28 +00:00
|
|
|
gulp.src('assets/css/main.css')
|
|
|
|
.pipe(gif(inProduction, cssmin()))
|
2015-11-30 20:11:10 +00:00
|
|
|
.pipe(gulp.dest('production-assets/css'));
|
2015-11-26 01:49:28 +00:00
|
|
|
});
|
|
|
|
|
2015-11-30 20:11:10 +00:00
|
|
|
gulp.task('build-assets-js', function() {
|
2015-11-26 01:49:28 +00:00
|
|
|
gulp.src('assets/js/*')
|
|
|
|
.pipe(gif(inProduction, uglify()))
|
2015-11-30 20:11:10 +00:00
|
|
|
.pipe(gulp.dest('production-assets/js'));
|
2015-11-26 01:49:28 +00:00
|
|
|
});
|
|
|
|
|
2015-11-30 20:11:10 +00:00
|
|
|
gulp.task('build-assets', ['build-assets-css', 'build-assets-js']);
|
2015-11-26 01:49:28 +00:00
|
|
|
|
|
|
|
gulp.task('watch-app', function() {
|
|
|
|
nodemon({
|
|
|
|
script: 'app.js',
|
|
|
|
ext: 'js json',
|
|
|
|
env: {'NODE_ENV': 'development'}
|
|
|
|
});
|
|
|
|
});
|