tabler / tabler-icons

A set of over 5700 free MIT-licensed high-quality SVG icons for you to use in your web projects.
https://tabler.io/icons
MIT License
18.32k stars 918 forks source link

Building with Vite and SolidJS includes all icons #1203

Closed martinpengellyphillips closed 1 month ago

martinpengellyphillips commented 3 months ago

Description

When building my application (that uses @tabler/icons-solidjs) with Vite I was expecting icons to be tree shaken to only include the ones imported. But ALL icons are being included in the build.

Example import:

import {
  IconArrowNarrowRight,
  IconTrendingDown,
  IconTrendingUp,
} from "@tabler/icons-solidjs";

Running vite build results in all tabler icons being included, greatly bloating the application bundle.

I see there were related issues reported against Svelte integration., but none specific to the Solid integration.

Package

Version

3.11.0

Browser

Operating system

Steps to reproduce

  1. Add @tabler/icons-solidjs to package (pnpm add)
  2. Import an icon and use it (e.g. import { IconTrendingUp } from "@tabler/icons-solidjs";
  3. Run vite build (via pnpm run build)
  4. Note that ALL tabler icons are processed and included in the build.

Checklist

levinit commented 3 months ago

also in svelte, see https://github.com/tabler/tabler-icons/issues/669

odnamrataizem commented 2 months ago

Downgrading to the latest 2.x release fixed it for me, but I'd miss out on the new icons released since then.