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
# Whether "loaders.js" and one module per icon are dumped, to load an icon by its name
dump_loaders: true
# The icons to dump, all by default: "*" is a wildcard, "!" excludes
icons: []
# The directories scanned for the icons imported in JavaScript and used by <ux-icon> (see "ux:icons:lock")
scan_directories: ['%kernel.project_dir%/assets', '%kernel.project_dir%/templates']
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.
dump_loaders true Dumps loaders.js, loaders.d.ts and the icon modules, to load an icon by name. When false, previously dumped ones are removed.
icons [] (all) The icons to dump, see filtering.
scan_directories assets/, templates/ Scanned by ux:icons:lock for the icons imported in JavaScript and used by <ux-icon>.

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.