lucide-icons / lucide

Beautiful & consistent icon toolkit made by the community. Open-source project and a fork of Feather Icons.
https://lucide.dev
ISC License
10.99k stars 501 forks source link

Too many requests in dev mode #1933

Open PeterlitsZo opened 8 months ago

PeterlitsZo commented 8 months ago

Package

Version

^0.336.0

Browser

Operating system

Description

When I am using lucide-solid in my SolidStart project, I find that in the dev mode, it will request too many requests and let me must wait for > 1min. (I develop it in the remote machine, which is an Linux machine, and using Chrome / Arc / Firefox to interact with the project)

截屏2024-02-29 19 06 56

Here is the section of package.json of lucide-solid:

{
  // ...
  "exports": {
    ".": {
      "types": "./dist/types/lucide-solid.d.ts",
      "solid": "./dist/source/lucide-solid.js",
      "import": "./dist/esm/lucide-solid.js",
      "browser": "./dist/esm/lucide-solid.js",
      "require": "./dist/cjs/lucide-solid.js",
      "node": "./dist/cjs/lucide-solid.js"
    }
  }
  // ...
}

It looks like it just using the "./dist/source/lucide-solid.js", which has bad performance when in development.

Steps to reproduce

Here I am using the SolidStart framework and Bun so you can:

bunx create-solid@latest
bun install
bun run dev

Then you can install the lucide-solid and import it in any file.

Checklist

jguddas commented 8 months ago

Possibly related to https://github.com/vitejs/vite/issues/8237

PeterlitsZo commented 8 months ago

Just a question: could we import a icon by import ChevronDownSquare from "lucide-solid/chevron-down-square"?

ericfennis commented 8 months ago

@PeterlitsZo Hmm not possible at the moment. Solid currently requires to have a bundled ESM file.

mifreudenthaler commented 4 months ago

any news on this? having the same problem.

floratmin commented 2 months ago

I have the same problem. As soon I load one icon all icons are loaded in dev mode and my computer starts to struggle.