Browserify transform that allows you to require images -> base64* data uri's.
* base64 only for raster images, svgs are inlined as svg+xml, because reasons...
npm install --save imgurify
browserify -t imgurify entry.js
var pony = require('./graphics/pony.png')
console.log(pony)
// => data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADcA...
- Total rewrite
- Reading files "manually" becuase weird browserify buffer behaviour (hoping to revert this back in the future)
- Fixed incorrect mimetype for
jpg
- Fixed base64 encoding of large (multibuffer) raster images
- Added a cli
imgurify path/to/img.svg > img.js
😍
- Support for svg
- Initial release 🎉
enjoy.