lukemelia / broccoli-base64-css

Broccoli plugin to replace reference to images in CSS with base64 strings
4 stars 5 forks source link

broccoli-base64-css

Broccoli plugin to replace asset urls in CSS with base64 strings.

Install

npm install --save broccoli-base64-css

Example

var base64CSS = require('broccoli-base64-css');

// Example with default options
var tree = base64CSS(tree, {
  imagePath: 'public'
, fontPath: 'public'
, maxFileSize: 4096 // larger files will be left untouched
, extensions: ['css']
, fileTypes: ['png', 'jpg', 'jpeg', 'gif', 'svg']
, assetsFromTree: false // look for images in same tree
                        // as css, rather than at static paths
                        // default: false
});