This package provides a webpack loader for Avatars sprite collections.
npm install --save-dev @dicebear/avatars-webpack-loader
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.jsmoduleexports =// ...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.
- @dicebear/avatars-webpack-config Example webpack configuration for Avatars sprites SVG.