Xulai / broccoli-imagemin

Use imagemin in your broccoli build pipeline

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

License:ISC License


Languages

Language:JavaScript 100.0%