diff options
author | Indrajith K L | 2018-08-14 09:33:19 +0530 |
---|---|---|
committer | Indrajith K L | 2018-08-14 09:33:19 +0530 |
commit | e1f9fdc2c83d0b15286aeb8f39be34e8612e2ec3 (patch) | |
tree | 13adf50b1bc3ce80cd364ca4e9bb8c0245d20b90 /gulpfile.js | |
parent | cc2cf2ddd45177c6ec6d15663eb84f99733944d3 (diff) | |
download | js13kgames-template-e1f9fdc2c83d0b15286aeb8f39be34e8612e2ec3.tar.gz js13kgames-template-e1f9fdc2c83d0b15286aeb8f39be34e8612e2ec3.tar.bz2 js13kgames-template-e1f9fdc2c83d0b15286aeb8f39be34e8612e2ec3.zip |
Adds gulp task to remove folders. :lipstick:
* Previously most of the temp folder will become a gunk yard if libraries are removed & new one's are added,
effect is final archive.zip size is huge because it contains stray files.
Diffstat (limited to 'gulpfile.js')
-rw-r--r-- | gulpfile.js | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/gulpfile.js b/gulpfile.js index 0bb7f86..2fc8d42 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,18 +1,20 @@ 'use strict'; -var gulp = require('gulp'); -var browserSync = require('browser-sync'); -var uglify = require('gulp-uglify'); -var zip = require('gulp-vinyl-zip').zip; -var size = require('gulp-size'); -var runSequence = require('run-sequence'); -let rollup = require('rollup-stream'); - -var source = require('vinyl-source-stream'); -var libs = ['./node_modules/kontra/kontra.min.js', './node_modules/tinymusic/dist/TinyMusic.min.js']; -var devLibs = ['./node_modules/jsfxr/jsfxr.js']; -var libFolder = 'libs/'; -var outputTemp = 'temp/'; +const gulp = require('gulp'); +const browserSync = require('browser-sync'); +const uglify = require('gulp-uglify'); +const zip = require('gulp-vinyl-zip').zip; +const size = require('gulp-size'); +const runSequence = require('run-sequence'); +const rollup = require('rollup-stream'); +const del = require('del'); + + +const source = require('vinyl-source-stream'); +const libs = ['./node_modules/kontra/kontra.min.js', './node_modules/tinymusic/dist/TinyMusic.min.js']; +const devLibs = ['./node_modules/jsfxr/jsfxr.js']; +const libFolder = 'libs/'; +const outputTemp = 'temp/'; gulp.task('serve', ['copylibs', 'copylibsDev', 'uglyfy_copy'], function () { browserSync.init({ @@ -32,6 +34,11 @@ gulp.task('reload', function () { browserSync.reload(); }); +gulp.task('delete_folders', function(){ + return del(['libs/','public/','temp/','dist/']).then(function(paths){ + console.log('Deleted Files & folders ',paths); + }); +}); gulp.task('uglyfy_copy', function () { return rollup({ @@ -74,5 +81,5 @@ gulp.task('prepare_dist_folder', function () { }); gulp.task('release', function () { - runSequence('copylibs', 'copylibsDev', 'uglyfy_copy', 'prepare_dist_folder', 'zipFiles'); + runSequence('delete_folders','copylibs', 'copylibsDev', 'uglyfy_copy', 'prepare_dist_folder', 'zipFiles'); }); |