Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building with Vite and SolidJS includes all icons #1203

Open
4 of 30 tasks
martinpengellyphillips opened this issue Jul 26, 2024 · 2 comments · May be fixed by #1221
Open
4 of 30 tasks

Building with Vite and SolidJS includes all icons #1203

martinpengellyphillips opened this issue Jul 26, 2024 · 2 comments · May be fixed by #1221
Labels
bug Something isn't working

Comments

@martinpengellyphillips
Copy link

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

  • @tabler/icons
  • @tabler/icons-eps
  • @tabler/icons-pdf
  • @tabler/icons-png
  • @tabler/icons-webfont
  • @tabler/icons-sprite
  • @tabler/icons-preact
  • @tabler/icons-react
  • @tabler/icons-react-native
  • @tabler/icons-solid
  • @tabler/icons-svelte
  • @tabler/icons-vue
  • Figma plugin
  • source/main
  • other/not relevant

Version

3.11.0

Browser

  • Chrome/Chromium
  • Firefox
  • Safari
  • Edge
  • iOS Safari
  • Opera
  • Other/not relevant

Operating system

  • Windows
  • Linux
  • macOS
  • ChromeOS
  • iOS
  • Android
  • Other/not relevant

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

  • I have searched if someone has submitted a similar issue before and there weren't any. (Please make sure to also search closed issues, as this issue might already have been resolved.)
@martinpengellyphillips martinpengellyphillips added the bug Something isn't working label Jul 26, 2024
@levinit
Copy link

levinit commented Jul 30, 2024

also in svelte, see #669

@odnamrataizem
Copy link

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

@inetol inetol linked a pull request Sep 13, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
3 participants