blob: cc79d11e2d84be4ea4a1e2d2f954f4f8d6972e9b [file] [log] [blame]
Tyler Scottcdfcde82015-09-14 16:13:29 -06001var gulp = require('gulp');
Tyler Scotte564a5a2015-09-16 17:43:33 -06002var minifyHTML = require('gulp-minify-html');
3var minifyCSS = require('gulp-minify-css');
4var sourcemaps = require('gulp-sourcemaps');
5var closure = require('gulp-closure-compiler-service');
6var clean = require('gulp-clean');
Tyler Scottcdfcde82015-09-14 16:13:29 -06007
Tyler Scotte564a5a2015-09-16 17:43:33 -06008gulp.task('minify-html', function() {
9
10 return gulp.src(['./catalog-dev/index.html'])
11 .pipe(minifyHTML())
12 .pipe(gulp.dest('./catalog/'));
Tyler Scottcdfcde82015-09-14 16:13:29 -060013
14});
15
Tyler Scotte564a5a2015-09-16 17:43:33 -060016gulp.task('minify-js', function() {
17
18 return gulp.src('./catalog-dev/js/*.js')
19 .pipe(sourcemaps.init())
20 .pipe(closure())
21 .pipe(sourcemaps.write('../../catalog-dev/js'))
22 .pipe(gulp.dest('./catalog/js'));
23
24});
25
26gulp.task('minify-css', function() {
27
28 return gulp.src(['./catalog-dev/css/style.css', './catalog-dev/css/cubeLoader.css'])
29 .pipe(sourcemaps.init())
30 .pipe(minifyCSS())
31 .pipe(sourcemaps.write('../../catalog-dev/css'))
32 .pipe(gulp.dest('./catalog/css'));
33
34});
35
36gulp.task('copy', function() {
37
38 gulp.src('./catalog-dev/config.json')
39 .pipe(gulp.dest('./catalog'));
40
41 gulp.src('./catalog-dev/css/*.min.css')
42 .pipe(gulp.dest('./catalog/css'));
43
44});
45
46gulp.task('clean', function(){
47
48 return gulp.src('./catalog', {read: false})
49 .pipe(clean());
50
51});
52
53gulp.task('default', ['minify-html', 'minify-css', 'minify-js', 'copy']);
54