gulp-compress
v0.0.9
Published
An easy-to-use module to compress your *.css , *.js and *.html files.
Downloads
856
Maintainers
Readme
gulp-compress
An easy-to-use module to compress your *.css , *.js and *.html files.
Install
npm install gulp-compress
Usage
var gulp = require('gulp'),
options = {
src: './src',
dest: './dist'
};
require('gulp-compress')(gulp, options);
There are few tasks added in your gulp:
copy
: Copy files which are match these glob tooptions.dest
compress-html
:Compress *.html files which are underoptions.src
then output tooptions.dest
compress-css
:Compress *.css files which are underoptions.src
then output tooptions.dest
compress-js
:Compress *.js files which are underoptions.src
then output tooptions.dest
compress
:It's run above tasks parallel.
Now use them like this!
gulp compress
You may need gulp-es6-sass else :)
Options
All options and its default value are list on here. It's really self-explanation.
API
var gulp = require('gulp'),
Compress = require('gulp-compress'),
cps = Compress(gulp);
Compress.minifyJs
Equal to require('gulp-uglify')
. See more info at gulp-uglify.
Compress.minifyHtml
Equal to require('gulp-htmlmin')
. See more info at gulp-htmlmin.
Compress.minifyCss
Equal to require('gulp-minify-css')
. See more info at gulp-minify-css.
cps.copy([globs, dest])
Copy files from globs
to dest
.
globs
{String|String[]} - Default value isoptions.copyFiles
dest
{String} - Default value isoptions.dest
cps.compressJs([globs, dest])
Compress js files from globs
to dest
.
globs
{String|String[]} - Default value isoptions.jsFiles
dest
{String} - Default value isoptions.dest
cps.compressCss([globs, dest])
Compress css files from globs
to dest
.
globs
{String|String[]} - Default value isoptions.cssFiles
dest
{String} - Default value isoptions.dest
cps.compressHtml([globs, dest])
Compress html files from globs
to dest
.
globs
{String|String[]} - Default value isoptions.htmlFiles
dest
{String} - Default value isoptions.dest
cps.compress([callback])
Equal to gulp compress
.
callback
{Function}
License
MIT