This package has been deprecated

    Author message:

    Loader is no longer needed for Avatars v3.

    @dicebear/avatars-webpack-loader

    2.1.0 • Public • Published

    Build Status npm

    This package provides a webpack loader for Avatars sprite collections.

    Installation

    npm install --save-dev @dicebear/avatars-webpack-loader
    

    Usage

    Create an SVG file with uniquely named groups on the first level. You can access these groups later with the Loader. These groups represent a sprite group, such as the eyes of a character.

    The uniquely named groups must contain other groups, which each display a variation. (For example, a variation of the eyes.)

    // webpack.config.js
     
    module.exports = {
      // ...
      resolve: {
        extensions: ['.js', '.svg']
      },
      module: {
        rules: [{ test: /\.svg$/, exclude: /node_modules/, loader: '@dicebear/avatars-webpack-loader' }]
      }
      // ...
    };

    Now you can load your sprite collection SVG files in your JS file.

    // sprites.js
     
    import * as svg from 'sprites.svg';
     
    export default new SpriteCollection([
      new Sprite(svg.eyes, colors)
      // ...
    ]);

    Related

    Keywords

    none

    Install

    npm i @dicebear/avatars-webpack-loader

    DownloadsWeekly Downloads

    5

    Version

    2.1.0

    License

    MIT

    Unpacked Size

    122 kB

    Total Files

    10

    Last publish

    Collaborators

    • avatar
    • avatar