From 295c0518cb382e60dad191247488ec21a1244f87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xose=20P=C3=A9rez?= Date: Fri, 14 Jul 2017 23:00:04 +0200 Subject: [PATCH] Cleanup gulp dependencies --- code/gulpfile.js | 25 ++++--------------------- code/package.json | 9 +++------ 2 files changed, 7 insertions(+), 27 deletions(-) diff --git a/code/gulpfile.js b/code/gulpfile.js index 582174d6..3a7d656f 100644 --- a/code/gulpfile.js +++ b/code/gulpfile.js @@ -25,19 +25,16 @@ along with this program. If not, see . const fs = require('fs'); const gulp = require('gulp'); -const plumber = require('gulp-plumber'); const htmlmin = require('gulp-htmlmin'); const cleancss = require('gulp-clean-css'); const uglify = require('gulp-uglify'); const gzip = require('gulp-gzip'); const del = require('del'); -const useref = require('gulp-useref'); -const gulpif = require('gulp-if'); const inline = require('gulp-inline'); const inlineImages = require('gulp-css-base64'); const favicon = require('gulp-base64-favicon'); -const dataFolder = 'espurna/data/'; +const dataFolder = 'espurna/static/'; gulp.task('clean', function() { del([ dataFolder + '*']); @@ -55,7 +52,7 @@ gulp.task('files', ['clean'], function() { gulp.task('buildfs_embeded', ['buildfs_inline'], function() { var source = dataFolder + 'index.html.gz'; - var destination = dataFolder + '../static/index.html.gz.h'; + var destination = dataFolder + 'index.html.gz.h'; var wstream = fs.createWriteStream(destination); wstream.on('error', function (err) { @@ -76,6 +73,8 @@ gulp.task('buildfs_embeded', ['buildfs_inline'], function() { wstream.write('\n};') wstream.end(); + del([source]); + }); gulp.task('buildfs_inline', ['clean'], function() { @@ -97,20 +96,4 @@ gulp.task('buildfs_inline', ['clean'], function() { .pipe(gulp.dest(dataFolder)); }) -gulp.task('buildfs_split', ['files'], function() { - return gulp.src('html/*.html') - .pipe(useref()) - .pipe(plumber()) - .pipe(gulpif('*.css', cleancss())) - .pipe(gulpif('*.js', uglify())) - .pipe(gulpif('*.html', htmlmin({ - collapseWhitespace: true, - removeComments: true, - minifyCSS: true, - minifyJS: true - }))) - .pipe(gzip()) - .pipe(gulp.dest(dataFolder)); -}); - gulp.task('default', ['buildfs_embeded']); diff --git a/code/package.json b/code/package.json index 3bcf590c..3d34daef 100644 --- a/code/package.json +++ b/code/package.json @@ -1,6 +1,6 @@ { "name": "esp8266-filesystem-builder", - "version": "0.1.0", + "version": "0.2.0", "description": "Gulp based build system for ESP8266 file system files", "main": "gulpfile.js", "author": "Xose PĂ©rez ", @@ -9,15 +9,12 @@ "del": "^2.2.1", "gulp": "^3.9.1", "gulp-base64-favicon": "^1.0.2", - "gulp-clean-css": "^2.0.10", + "gulp-clean-css": "^3.4.2", "gulp-css-base64": "^1.3.4", "gulp-gzip": "^1.4.0", "gulp-htmlmin": "^2.0.0", - "gulp-if": "^2.0.1", "gulp-inline": "^0.1.1", - "gulp-plumber": "^1.1.0", - "gulp-uglify": "^1.5.3", - "gulp-useref": "^3.1.2" + "gulp-uglify": "^1.5.3" }, "dependencies": {} }