gulp-compress

    0.0.9 • Public • Published

    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 to options.dest
    • compress-html:Compress *.html files which are under options.src then output to options.dest
    • compress-css:Compress *.css files which are under options.src then output to options.dest
    • compress-js:Compress *.js files which are under options.src then output to options.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 is options.copyFiles
    • dest {String} - Default value is options.dest

    cps.compressJs([globs, dest])

    Compress js files from globs to dest.

    • globs {String|String[]} - Default value is options.jsFiles
    • dest {String} - Default value is options.dest

    cps.compressCss([globs, dest])

    Compress css files from globs to dest.

    • globs {String|String[]} - Default value is options.cssFiles
    • dest {String} - Default value is options.dest

    cps.compressHtml([globs, dest])

    Compress html files from globs to dest.

    • globs {String|String[]} - Default value is options.htmlFiles
    • dest {String} - Default value is options.dest

    cps.compress([callback])

    Equal to gulp compress.

    • callback {Function}

    License

    MIT

    Install

    npm i gulp-compress

    DownloadsWeekly Downloads

    252

    Version

    0.0.9

    License

    MIT

    Last publish

    Collaborators

    • milklee