image-source-loader

0.6.5 • Public • Published

image source loader for webpack

A source is an object contains: base64 uri, width and height of a image. eg: { uri: 'data:image/png;base64, iVBxxxx...', width: 2, height: 3 }

If your looking for a loader that simple encodes as base64 try base64-loader

Installation

npm install image-source-loader

Usage

const source = require("image-source!./1x1.png");
 
// source => {
//   uri: "data:image/png;base64,iVBORw0KGgoAAAANS...",
//   width: 1,
//   height: 1
// }

Documentation: Using loaders

Support

See ./mimes.json for currently supported extensions/mimes.
Create a Pull Request if you need more added.

/image-source-loader/

    Package Sidebar

    Install

    npm i image-source-loader

    Weekly Downloads

    416

    Version

    0.6.5

    License

    MIT

    Unpacked Size

    8.04 kB

    Total Files

    8

    Last publish

    Collaborators

    • zeroling
    • wintercn
    • yuanyan
    • yacheng
    • rax-publisher