Browse Source

Cleanup gulp dependencies

fastled
Xose Pérez 6 years ago
parent
commit
295c0518cb
2 changed files with 7 additions and 27 deletions
  1. +4
    -21
      code/gulpfile.js
  2. +3
    -6
      code/package.json

+ 4
- 21
code/gulpfile.js View File

@ -25,19 +25,16 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
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']);

+ 3
- 6
code/package.json View File

@ -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 <xose.perez@gmail.com>",
@ -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": {}
}

Loading…
Cancel
Save