Skip to content
Vittorio Vittori edited this page Feb 8, 2023 · 10 revisions

Iconsauce can be used directly via it's npm CLI.

iconsauce --config path/to/iconsauce.config.js --output-css path/to/iconsauce.css

Here you can find a list of flags can be passed to the CLI.

Flag Abbreviation Default Description
--config -c ./iconsauce.config.js Defines the path of iconsauce config.
--output-css -oc undefined Defines the path of the CSS file generated by iconsauce.
--output-dictionary -od undefined Defines the path of the JSON file with the list of icons used.
--output-dump-svg -ods undefined Defines the path directory of the SVGs used in the build and it saves ALL svg found inside svg icon sets.
--output-svg -os undefined Defines the path directory of the SVGs defined in your code.
--skip-warnings -s true If the terminal should stop if warning are thrown.
--verbose -v false If the terminal should log verbose messages when iconsauce builds.

You can use iconsauce from you node scripts:

"scripts": {
  "build": "iconsauce --config path/to/iconsauce.config.js --output-css path/to/iconsauce.css"
}

You can choose the output you need:

iconsauce --config path/to/iconsauce.config.js --output-dictionary path/to/dictionary.json
iconsauce --config path/to/iconsauce.config.js --output-svg path/to/svg/

Yarn

If you are using yarn, you can use iconsauce bin directly:

iconsauce --config path/to/iconsauce.config.js --output-svg path/to/svg/

NPM issues

If you install iconsauce with NPM, the iconsauce bin file is not created for some reason, so commands run by NPM do not find it. Currently we are not clear what the reason is.

If you are using npm, please install npx to let it search for bin locally:

npx iconsauce --config path/to/iconsauce.config.js --output-svg path/to/svg/

Another workaround is to point directly to the bin file:

./node_modules/@iconsauce/core/lib/cli.js --config path/to/iconsauce.config.js --output-svg path/to/svg/

Clone this wiki locally