ITADN

Remove unplugin-icons requirement

#618Closedtechniq 创建于 2025-07-08
T
techniqcommented
After [overhauling icons](https://github.com/techniq/svelte-ux/pull/616) (and including component support) in [2.0.0-next.14](https://github.com/techniq/svelte-ux/releases/tag/svelte-ux%402.0.0-next.14), there currently is a requirement to setup [unplugin-icons](https://github.com/unplugin/unplugin-icons) to process the `~icons/*` imports that are used by default, but I'm hoping to not require this in the future (only needed due to using it to load the default Lucide iconset in `settings()`. To setup unplugin-icons with Lucide iconset, first install 2 packages: ``` pnpm i -D unplugin-icons @iconify-json/lucide ``` Then update your `vite.config.js` ([example](https://github.com/techniq/layerchart/blob/next/packages/layerchart/vite.config.js#L36-L38)) to process the `~icons/*` ```js import { sveltekit } from '@sveltejs/kit/vite'; import tailwindcss from '@tailwindcss/vite'; import Icons from 'unplugin-icons/vite'; /** @type {import('vite').UserConfig} */ const config = { plugins: [ tailwindcss(), sveltekit(), Icons({ compiler: 'svelte', }), ], optimizeDeps: { exclude: ['~icons'], }, }; export default config; ``` Unplugin-icons is wonderful and I use it on all my projects (along with the [Icônes](https://icones.js.org/) icon browser) but it probably shouldn't be required, or at least the setup is streamlined.
关闭于 2025-07-30 0 条评论