Created
July 26, 2019 20:04
-
-
Save tripflex/7e1904f10aabf36385226d52157a06d4 to your computer and use it in GitHub Desktop.
Gulp tasks for Mongoose OS to minify mJS code to save space on devices
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var pump = require('pump'); | |
var strip = require('gulp-strip-comments'); | |
var cleanhtml = require('gulp-cleanhtml'); | |
var flatten = require('gulp-flatten'); | |
var replace = require('gulp-replace'); | |
gulp.task('mindeps', function () { | |
return gulp.src('deps/**/**/*.js', { base: "./" }) | |
.pipe(strip()) | |
.pipe(cleanhtml()) | |
.pipe(gulp.dest('.')); | |
}); | |
gulp.task('minfs', function (cb) { | |
pump([ | |
gulp.src(['fs/*.js', 'fs/**/*.js', '!fs/tmp/*', '!fs/test/*']), | |
strip(), | |
cleanhtml(), | |
flatten(), | |
gulp.dest('fs_min') | |
], | |
cb | |
); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The way I personally use this is by setting my
fs
inmos.yml
to thefs_min
directory, and before pushing just rungulp minfs