Skip to content

Configuration

The defaults fit most applications: the bundle works without configuration.

config/packages/silarhi_ux_icons_js.yaml
silarhi_ux_icons_js:
# The directory where the JavaScript module is dumped
dump_directory: '%kernel.project_dir%/var/icons'
# Whether TypeScript types are dumped alongside the icons
dump_typescript: true
# The directories scanned for icons imported in JavaScript files (see "ux:icons:lock")
scan_directories: ['%kernel.project_dir%/assets']
when@prod:
silarhi_ux_icons_js:
# useless in production with AssetMapper
dump_typescript: false
Option Default Description
dump_directory %kernel.project_dir%/var/icons Where index.js, loaders.js, the icon modules and their types are dumped. Mapped as var/icons with AssetMapper.
dump_typescript true Dumps index.d.ts and loaders.d.ts. When false, previously dumped ones are removed.
scan_directories ['%kernel.project_dir%/assets'] Scanned by ux:icons:lock for the icons imported in JavaScript.

The icons are dumped with these UX Icons options, read from the ux_icons configuration:

Option Used for
icon_dir The local icons
icon_sets.*.path The local icon sets
aliases Extra exports, pointing to their target icon
default_icon_attributes The dumped attributes
icon_sets.*.icon_attributes The dumped attributes of the icon set
icon_sets.*.suffixes The dumped attributes of the matching suffix
Command Description
ux-icons-js:dump Dumps the local icons. -v lists them.
ux:icons:import (symfony/ux-icons) Dumps the icons again, prints the new exports.
ux:icons:lock (symfony/ux-icons) Same, and finds the icons imported in JavaScript.