Before the build Vueless automatically scan the project files and collects all the icons. If Vueless can't recognise the icon it may be skipped, what mean's it will be lost after build.
To avoid this behavior and include all the icons into the build, please follow rules below or add needed icons into the safelist.
<!-- ✅ this will work (string) --><UIconname="close" /><!-- ✅ this will work too (ternary operator with strings) --><UIconname="isOpened ? 'arrow_up' : 'arrow_down'" /><!-- 🛑 this won't work (variable) --><UIcon:name="stateIcon" />
If you need to use icon names in JS you should declare the icon names in any of JS object. If the key in the object includes icon word it will be automatically recognised by Vueless and icon will be added to the build.
<UIcon:name="stateIcon" /><scriptsetup>import { computed } from"vue";/* here is the trick */consticons= { iconArrowUp:"arrow_up", iconArrowDown:"arrow_down",}conststateIcon=computed(() => isOpened ?icons.iconArrowUp :icons.iconArrowDown);</script>
Icons safelist
if you don't want to use object approach you can simply add needed icons into the safelist.
In this case regular and filled icon variants will be safelisted and added into the build.
Replace all icons at once
If you going to use bootstrap-icons or heroicons you need to replace icon names in all needed Vueless components. You can easily do that by using the config below:
For loading SVG @vueless/plugin-vite use SVGO by default. We created and already included optimal config to cover most of the cases, but if you will face with some issues with SVG rendering feel free to change it by passing you own config under the svgoConfig key, (see SVGO plugin docs).