From a725ddb06cf6fd8c52e7f1a5f332d686019a1234 Mon Sep 17 00:00:00 2001 From: Tommy Parnell Date: Fri, 21 Aug 2015 13:46:05 -0400 Subject: [PATCH] fix some minify things --- deploy.cmd | 21 ++++++++++++--------- gulpfile.js | 10 +++++++++- package.json | 1 + 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/deploy.cmd b/deploy.cmd index d8fa239..3191720 100644 --- a/deploy.cmd +++ b/deploy.cmd @@ -105,24 +105,27 @@ IF EXIST "%DEPLOYMENT_TARGET%\package.json" ( popd ) -:: 4. Install gulp -IF EXIST "%DEPLOYMENT_TARGET%\gulpfile.js" ( - pushd "%DEPLOYMENT_TARGET%" - call :ExecuteCmd !NPM_CMD! install gulp gulp-cache-bust gulp-concat-css gulp-uglify html-minifier gulp-concat - call .\node_modules\.bin\gulp publish - IF !ERRORLEVEL! NEQ 0 goto error - popd -) - :: 5. Install bower IF EXIST "%DEPLOYMENT_TARGET%\bower.json" ( pushd "%DEPLOYMENT_TARGET%" + call rmdir .\components call :ExecuteCmd !NPM_CMD! install bower call .\node_modules\.bin\bower install IF !ERRORLEVEL! NEQ 0 goto error popd ) + +:: 4. Install gulp +IF EXIST "%DEPLOYMENT_TARGET%\gulpfile.js" ( + pushd "%DEPLOYMENT_TARGET%" + call :ExecuteCmd !NPM_CMD! install gulp gulp-cache-bust gulp-concat-css gulp-uglify html-minifier gulp-concat gulp-rimraf + call .\node_modules\.bin\gulp publish + IF !ERRORLEVEL! NEQ 0 goto error + popd +) + + :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: Post deployment stub diff --git a/gulpfile.js b/gulpfile.js index e1d99a6..8835cf1 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -8,7 +8,8 @@ var gulp = require('gulp'), minifyCss = require('gulp-minify-css'), minify = require('html-minifier').minify, fs = require("fs"), - concat = require('gulp-concat'); + concat = require('gulp-concat'), + rimraf = require('gulp-rimraf'); @@ -18,6 +19,11 @@ gulp.task('watch', function() { gulp.watch('./css/*.css'); }); +gulp.task('clean', function(){ + return gulp.src(['js/bowr.js', 'css/bundle.css'], { read: false }) // much faster + .pipe(rimraf()); +}); + gulp.task('combineCss', function(){ return gulp.src('./css/*.css') @@ -82,6 +88,7 @@ gulp.task('cachebust', function(){ }); gulp.task('publish', [ + 'clean', 'minfiyCss', 'minifyHtml', 'minifyJs', @@ -89,6 +96,7 @@ gulp.task('publish', [ ]); gulp.task('default', [ + 'clean', 'develop', 'combineJs', 'combineCss', diff --git a/package.json b/package.json index 2114dbd..c5aa870 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "gulp-minify-css": "^1.2.0", "gulp-nodemon": "~2.0.2", "gulp-plumber": "~1.0.0", + "gulp-rimraf": "^0.1.1", "gulp-uglify": "^1.2.0" } }