1
restaurant-search/client/gulpfile.js

59 lines
1.7 KiB
JavaScript
Raw Normal View History

2014-09-30 07:11:54 +00:00
var concat = require('gulp-concat');
var gulp = require('gulp');
2014-09-30 07:36:48 +00:00
var inject = require('gulp-inject');
2014-09-30 07:11:54 +00:00
var jshint = require('gulp-jshint');
var minifyCss = require('gulp-minify-css');
var sourcemaps = require('gulp-sourcemaps');
var uglify = require('gulp-uglify');
2014-09-26 08:14:42 +00:00
var paths = {
js: [
'bower_components/underscore/underscore.js',
'bower_components/handlebars/handlebars.min.js',
'bower_components/jquery/dist/jquery.min.js',
'bower_components/fabric/dist/fabric.min.js',
'bower_components/tinycolor/tinycolor.js',
'bower_components/bootstrap/dist/js/bootstrap.min.js',
'bower_components/bootstrap-select/dist/js/bootstrap-select.min.js',
2014-09-26 08:14:42 +00:00
'js/*.js'
2014-09-30 07:11:54 +00:00
],
css: [
'bower_components/bootstrap/dist/css/bootstrap.min.css',
'bower_components/bootstrap/dist/css/bootstrap-theme.min.css',
'bower_components/bootstrap-select/dist/css/bootstrap-select.min.css',
'css/*.css'
],
2014-09-30 07:36:48 +00:00
html: [
'index.html'
]
2014-09-26 08:14:42 +00:00
};
gulp.task('lint', function() {
return gulp.src('js/*.js')
.pipe(jshint())
.pipe(jshint.reporter('default'));
});
gulp.task('scripts', function() {
return gulp.src(paths.js)
2014-09-30 07:11:54 +00:00
.pipe(concat('scripts.js'))
2014-09-26 08:14:42 +00:00
.pipe(uglify())
.pipe(gulp.dest('dist'));
});
2014-09-30 07:11:54 +00:00
gulp.task('styles', function() {
return gulp.src(paths.css)
.pipe(concat('styles.css'))
.pipe(minifyCss())
.pipe(gulp.dest('dist'));
});
2014-09-30 07:36:48 +00:00
gulp.task('pages', function() {
var sources = gulp.src(paths.js.concat(paths.css), { read: false });
return gulp.src(paths.html)
.pipe(inject(sources))
.pipe(gulp.dest('dist'));
});
gulp.task('default', ['lint', 'scripts', 'styles', 'pages']);