2.0.0 • Published 6 years ago
@dicebear/avatars-webpack-config v2.0.0
This package provides a standard webpack configuration for DiceBear Avatars sprite collections.
Installation
npm install --save-dev @dicebear/avatars-webpack-config
Usage
// webpack.config.js
var avatarsWebpackSprites = require('@dicebear/avatars-webpack-config');
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-config/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 collection SVG.