This package provides a standard webpack configuration for Avatars sprites.
Installation
npm install --save-dev @dicebear/avatars-webpack-sprites
Usage
// webpack.config.js
var avatarsWebpackSprites = require('@dicebear/avatars-webpack-sprites');
var name = 'your-sprite-set-name';
var options = {
// See below for default options
};
let config = avatarsWebpackSprites(spriteSetName, options);
module.exports = [config.node, config.web.dev, config.web.prod];
If you use Typescript, you can optionally add the following option in your tsconfig.json
{
"extends": "./node_modules/@dicebear/avatars-webpack-sprites/tsconfig.json",
"include": ["./src/"]
}
Options
dirname
Default: process.cwd()
Your project root directory.
entry
Default: ./src/sprites.ts
Your project entry file relative to directory
.
output.path.web
Default: ./dist
Output path for compiled web (browser) version relative to directory
.
output.path.node
Default: ./lib
Output path for compiled node version relative to directory
.
output.path.name
Default: sprites
Output filename without suffix (i.e. .min) and file extension (.js).
Related
- @dicebear/avatars-webpack-loader Loader for sprite set SVG.