Added gulp support.
Gulp allows for sanitization before publication. It is similar to make
but has more features.
Change-Id: Ib4cd5042a5af4b63de9d0a5004c2b0c62cb5ca1d
diff --git a/client/gulpfile.js b/client/gulpfile.js
index 53e2f10..cc79d11 100644
--- a/client/gulpfile.js
+++ b/client/gulpfile.js
@@ -1,6 +1,54 @@
var gulp = require('gulp');
+var minifyHTML = require('gulp-minify-html');
+var minifyCSS = require('gulp-minify-css');
+var sourcemaps = require('gulp-sourcemaps');
+var closure = require('gulp-closure-compiler-service');
+var clean = require('gulp-clean');
-gulp.task('default, function() {
+gulp.task('minify-html', function() {
+
+ return gulp.src(['./catalog-dev/index.html'])
+ .pipe(minifyHTML())
+ .pipe(gulp.dest('./catalog/'));
});
+gulp.task('minify-js', function() {
+
+ return gulp.src('./catalog-dev/js/*.js')
+ .pipe(sourcemaps.init())
+ .pipe(closure())
+ .pipe(sourcemaps.write('../../catalog-dev/js'))
+ .pipe(gulp.dest('./catalog/js'));
+
+});
+
+gulp.task('minify-css', function() {
+
+ return gulp.src(['./catalog-dev/css/style.css', './catalog-dev/css/cubeLoader.css'])
+ .pipe(sourcemaps.init())
+ .pipe(minifyCSS())
+ .pipe(sourcemaps.write('../../catalog-dev/css'))
+ .pipe(gulp.dest('./catalog/css'));
+
+});
+
+gulp.task('copy', function() {
+
+ gulp.src('./catalog-dev/config.json')
+ .pipe(gulp.dest('./catalog'));
+
+ gulp.src('./catalog-dev/css/*.min.css')
+ .pipe(gulp.dest('./catalog/css'));
+
+});
+
+gulp.task('clean', function(){
+
+ return gulp.src('./catalog', {read: false})
+ .pipe(clean());
+
+});
+
+gulp.task('default', ['minify-html', 'minify-css', 'minify-js', 'copy']);
+