Skip to content

Prebundling of libraries with Svelte components #2612

Closed
@benmccann

Description

@benmccann

Describe the bug

See illright/attractions#311 (comment) for the original report

It was loading all of svelte-feather-icons when you use just a few icons. Vite is supposed to do dependency pre-bundling to avoid this: https://vitejs.dev/guide/dep-pre-bundling.html#the-why. However, Vite's pre-bundling uses esbuild, so we disabled it on Svelte components because it doesn't know what to do with .svelte files.

Evan has proposed changing this. I'm finally a convert to the idea.

Reproduction

Try to use svelte-feather-icons

Logs

https://github.com/illright/attractions/ was making 485 requests for each page in dev mode taking 10s to load

System Info

Vite 2.6.7

Severity

serious, but I can work around it

Additional Information

You can work around it by doing deep imports

Metadata

Metadata

Assignees

Labels

feature / enhancementNew feature or requestp1-importantSvelteKit cannot be used by a large number of people, basic functionality is missing, etc.size:largesignificant feature with tricky design questions and multi-day implementationvite

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions