JSPM

gulp-unimage

0.2.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4
  • Score
    100M100P100Q19492F
  • License MIT

Remove unused image file

Package Exports

  • gulp-unimage

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (gulp-unimage) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

gulp-unimage

It's a gulp plugin that help you filter some unsed image when package images.

Install

With npm do:

npm install gulp-unimage --save-dev

Example

You can use single files, globbing patterns or URLS to run gulp-unimage:

var gulp = require('gulp')
var gulpUnimage = require('../index')

gulp.task('default', function(){
    gulp.src(['../test/fixture/images/**/*', '../test/fixture/subfolder/images/**/*'], {base: '../test/fixture/'})
        .pipe(gulpUnimage({
            files: '../test/fixture/**/*.{css,html}',
            base: '../test/fixture/',
            exclude: '../test/fixture/images/exclude/**/*',
            debug: true
        }))
        .pipe(gulp.dest('dist/'))
})

Options

option.files

Type: Array|String Required value

The base files(html|css), we find in this base files, and make sure the image is used or not.

option.base

Type: String

Default: ''

You can change html or css files base path to another, in order to find the right image path.

Please use carefully!!!

option.exclude

Type: Array|String

The File want to be exclude

Default: ''

option.debug

Type: boolean

Default: false

Run with debug mode

Release History

0.1.2

  • add image base support

0.0.3

  • add exclude files support
  • some known bugs fixed

0.0.2 Readme detail

0.0.1 Initial release