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

Bundle Components into 1 File #12944

Open
notchatbot opened this issue Oct 15, 2024 · 2 comments
Open

Bundle Components into 1 File #12944

notchatbot opened this issue Oct 15, 2024 · 2 comments
Labels
feature / enhancement New feature or request

Comments

@notchatbot
Copy link

Describe the problem

  • I have a route that is getting a lot of traffic.
  • That route uses many components and when compiled each of these components get compiled into 1 file each.
  • I use vercel to deploy my projects and vercel caches automatically on the edge network.
  • A lot of traffic + A lot of components = A huge bill
  • I can solve it hardcoding every component into my +page.svelte but clearly I don't want to do that.

For reference using Svelte 5 + SvelteKit.

Describe the proposed solution

I would need a way to compile every component into 1 file and if it is called from /+page.svelte with a lot of traffic use that big file. Or maybe even some docs on how to compile svelte into ES Module (I have found some, but they are all using rollup or really old versions of svelte). None of them uses sveltekit.

WebComponents are simply nasty and I don't want to deal with them. (Unless you tell me that they are the only way I won't use them).

Importance

i cannot use svelte without it

@eltigerchino
Copy link
Member

You may want to have a look at #3882 (comment) for a current workaround of reducing the number of chunks

@eltigerchino eltigerchino added the feature / enhancement New feature or request label Nov 12, 2024
@notchatbot
Copy link
Author

It's a good workaround. I've managed to do something like that but I had to create a new project within my project with vite and then bundle the sub-project into one js file and it worked. Still I want to use regular sveltekit to create cross-framework components (I know what you are thinking and I do not want to use web components)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature / enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants