Skip to content

Configuration

nicolatamburini edited this page Mar 19, 2025 · 12 revisions

Naming convention

Naming standard for configuration file:

  • .iconsaucerc.json
  • .iconsaucerc.js
  • .iconsaucerc.cjs
  • .iconsaucerc.mjs
  • .config/iconsaucerc
  • .config/iconsaucerc.json
  • .config/iconsaucerc.js
  • .config/iconsaucerc.cjs
  • .config/iconsaucerc.mjs
  • iconsauce.config.js
  • iconsauce.config.cjs
  • .iconsauce.config.mjs

Configuration properties

Is basically simple to setup and should be placed in the root of your project.

Property Type Default Description
center boolean false It centers the icon in the center of the font gliph. Set center to true is NOT recommended for pixel perfect icons like Material Icons, also this, if an icon is not centered for design reasons, it will be centered causing optical unbalancment, be aware of that.
content string[] Required Accepts an array of glob patterns that should points to your code files where icons are supposed to be shown.
fontSize string 24px The font-size set for the CSS icon font.
fontFamily string iconsauce The @font-face and font-family set for the CSS icon font.
plugin IconsaucePlugin[] Default IS plugins An array of IconsaucePlugin objects to gather SVG icons and convert them with your naming conventions.
verbose boolean false If the terminal should log verbose messages when iconsauce builds.
skipWarnings boolean true If the build process throw an error and stops when an icon is not found.

CLI has additional options dedicated.

Config example

module.exports = {
  center: false,
  content: [
    './src/**/*.{tsx,ts,json}',
  ],
  fontSize: '24px',
  fontFamily: 'iconsauce',
  plugin: [
    require('@iconsauce/material-design-icons-updated'),
    require('@iconsauce/mdi-svg'),
    require('@iconsauce/mgg-icons'),
  ],
  verbose: false,
  skipWarnings: true,
}

Clone this wiki locally