Browse Source

Update filesystem builder script removing unnecessary dependencies and changing default target

fastled
Xose Pérez 8 years ago
parent
commit
3a47bd402c
3 changed files with 3 additions and 28 deletions
  1. +1
    -22
      code/gulpfile.js
  2. +1
    -5
      code/package.json
  3. +1
    -1
      code/pio_hooks.py

+ 1
- 22
code/gulpfile.js View File

@ -24,14 +24,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
const gulp = require('gulp'); const gulp = require('gulp');
const plumber = require('gulp-plumber');
const htmlmin = require('gulp-htmlmin'); const htmlmin = require('gulp-htmlmin');
const cleancss = require('gulp-clean-css'); const cleancss = require('gulp-clean-css');
const uglify = require('gulp-uglify'); const uglify = require('gulp-uglify');
const gzip = require('gulp-gzip'); const gzip = require('gulp-gzip');
const del = require('del'); const del = require('del');
const useref = require('gulp-useref');
const gulpif = require('gulp-if');
const inline = require('gulp-inline'); const inline = require('gulp-inline');
/* Clean destination folder */ /* Clean destination folder */
@ -69,24 +66,6 @@ gulp.task('inline', function() {
.pipe(gulp.dest('data')); .pipe(gulp.dest('data'));
}) })
/* Process HTML, CSS, JS */
gulp.task('html', 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('data'));
});
/* Build file system */ /* Build file system */
gulp.task('buildfs', ['clean', 'files', 'html']);
gulp.task('buildfs2', ['clean', 'files', 'inline']);
gulp.task('buildfs', ['clean', 'files', 'inline']);
gulp.task('default', ['buildfs']); gulp.task('default', ['buildfs']);

+ 1
- 5
code/package.json View File

@ -11,12 +11,8 @@
"gulp-clean-css": "^2.0.10", "gulp-clean-css": "^2.0.10",
"gulp-gzip": "^1.4.0", "gulp-gzip": "^1.4.0",
"gulp-htmlmin": "^2.0.0", "gulp-htmlmin": "^2.0.0",
"gulp-if": "^2.0.1",
"gulp-inline": "^0.1.1", "gulp-inline": "^0.1.1",
"gulp-plumber": "^1.1.0",
"gulp-uglify": "^1.5.3",
"gulp-useref": "^3.1.2",
"yargs": "^5.0.0"
"gulp-uglify": "^1.5.3"
}, },
"dependencies": {} "dependencies": {}
} }

+ 1
- 1
code/pio_hooks.py View File

@ -13,7 +13,7 @@ def is_valid_ip(ip):
return False return False
def before_build_spiffs(source, target, env): def before_build_spiffs(source, target, env):
env.Execute("gulp buildfs2")
env.Execute("gulp buildfs")
def before_upload(source, target, env): def before_upload(source, target, env):
upload_port = env.get('UPLOAD_PORT', False) upload_port = env.get('UPLOAD_PORT', False)


Loading…
Cancel
Save