rump-images
v0.8.0
Published
Rump piece for handling images
Downloads
10
Maintainers
Readme
Rump Images
Status
Master
Develop
About
Rump Images is a Rump module that handles images with support for image optimizations via imagemin and high density "retina" images. (retina support requires GraphicsMagick) For more information, visit the core repository.
API
The following is appended to the core Rump API:
rump.addGulpTasks(options)
This module adds the following tasks:
build:images
will process and copy images from source to destination. This task is also added to thebuild
task. Images that end with@2x
([email protected]
) will have copies made without the@2x
(logo.png
) and at half the resolution of the original. For more information on source and destination paths seerump.configure()
below. This task is also added to thebuild
task.watch:images
will runbuild:images
, then monitor for changes and process updated files as needed. This task is also added to thewatch
task.info:images
will display information on what this specific module does, specifically the source and destination paths as well as what files would get processed as well as those that would get retina copies. This task is also added to theinfo
task.
rump.configure(options)
Redefine options for Rump and Rump modules to follow. In addition to what options Rump and other Rump modules offer, the following options are available alongside default values:
options.images.minify
(options.environment === 'production'
)
This specifies whether to process images through imagemin. (processed if
true
) By default images are minified only if the environment is set to
production. (visit the main Rump repository for more information on
environment)
options.images.retina
(false
)
This specifies whether to create non-retina version of images. (denoted by
@2x
) By default this option is turned off. (If you turn on
GraphicsMagick is required)
options.images.imagemin
This specifies additional options for gulp-imagemin.
options.paths.source.images
('images'
)
This is the directory where images to be copied are contained. This path is
relative to the root source path. (If the default root and images path is used,
then the path would be src/images
)
options.paths.destination.images
('images'
)
This is the directory where images are copied to. This path is relative to the
root destination path. (If the default root and images path is used, then the
path would be dist/images
)
options.globs.build.images
('**/*.{gif,jpg,jpeg,png,svg}'
)
This specifies which images to process. By default it processes all GIF/JPEG/PNG/SVG images, including those in subdirectories.
options.globs.watch.images
('**/*.{gif,jpg,jpeg,png,svg}'
)
This specifies which images to monitor for changes. By default it watches all GIF/JPEG/PNG/SVG images, including those in subdirectories.