Skip to content

Broccoli plugin to replace reference to images in CSS with base64 strings

Notifications You must be signed in to change notification settings

lukemelia/broccoli-base64-css

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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
});

About

Broccoli plugin to replace reference to images in CSS with base64 strings

Resources

Stars

Watchers

Forks

Packages

No packages published