Skip to content

Xulai/broccoli-imagemin

Repository files navigation

broccoli-imagemin

NPM Build Status Dependency Status

Information

Packagebroccoli-imagemin
Description Use imagemin in your broccoli build pipeline

More information about the image minifier, imagemin can be found at https://github.com/kevva/imagemin. Whereas information about Broccoli which is the building asset pipeline this is for can be found at https://github.com/joliss/broccoli.

Usage

Example from the included test Brocfile.js

'use strict';

// Require imagemin so it can minify your images
var imagemin = require('./index');

// Make a tree using a string that points to the image directory
var imageTree = 'test/images';

// Create some options to pass into imagemin when minifying your images
var options = {
		interlaced: true,
		optimizationLevel: 3,
		progressive: true,
		lossyPNG: false
};

// Minify the images.
imageTree = imagemin(imageTree, options);

// Export the tree which is now holds the optimised images.
module.exports = imageTree;

Tests

> npm install -g broccoli-cli
> npm install -g mocha
> npm test

Or

> npm install -g broccoli-cli
> npm install -g mocha
> broccoli build temp
> mocha

About

Use imagemin in your broccoli build pipeline

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published