gulp-lazy-minify
v1.0.1
Published
This plugin is used to minify JS/CSS only when it's needed.
Downloads
2
Readme
gulp-lazy-minify
This plugin is used to minify JS/CSS only when it's needed.
There are currently 2 conditions where minifying is not needed:
- The source file is already minified
- There exists a minified version of the source file in the same directory
Usage
var gulp = require('gulp');
var lazyMinify = require('gulp-lazy-minify');
gulp.task('default', function () {
gulp.src(['sample/file1.js', 'sample/file2.js', 'sample/file3.min.js'])
.pipe(lazyMinify())
.pipe(gulp.dest('output'));
});
Assumptions:
- A JS file is a file with extension .js
- A CSS file is a file with extension .css
- A minified file is a file where it has .min before the extension
JS minification uses gulp-uglify
CSS minififcation uses gulp-minify-css