-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Single HTML file output #2042
Comments
Have you tried using the static adapter? It's not one single file, but you can certainly run it offline after you compile it. |
I discussed this in a recent StackOverflow question and concluded that the best option for my use case (static SPA) was to just use Though, if this could get added to SvelteKit core or the static adapter, it would allow almost any app to use SvelteKit as a foundation for building apps, which would be really good for DX! @tanekim77 Here's a starter project I made to create a SPA with only a single HTML file as the output: https://github.com/Greenheart/svelte-encrypted-spa. The encryption part can be removed if you don't need it. |
@Greenheart That would be awesome. I will give that a shot. |
If you have no interactivity on the page, you just need to set |
As far as building a file usable from local disk, see #907. I'm going to close this issue in favor of that one For inlining JS and CSS, I believe that would be controlled by Vite |
@benmccann looks like sveltekit is adding stuff that make it incompatible with vite-plugin-singlefile mentioned by @Greenheart here When using it and building it using static adapter I get the following error:
sveltekit is generated multiple inputs in the rollup config. is there any way to disable that somehow ? Note that I am aware this is issue is considered closed but my opinion is that it should be reopened. My reasoning is as follow: while fixing issue #907 could potentially fix this issue, it is still unclear why we should assume so. Having all the deps embedded in a single html would surely solve #907 but the reverse is dependent on the solution used to solve #907 |
I have the same issue. Will this be fixed soon? |
Describe the problem
It would be great if there was an option to inline all css and js into the index.html so that it can be served offline, without fancy ssr feature. This is a feature that I need for my project.
Do you think this feature is even feasible to implement?
Describe the proposed solution
I am beginner, so I have no idea if it's even possible.
Alternatives considered
I am beginner, so I have no idea if it's even possible.
Importance
i cannot use SvelteKit without it
Additional Information
No response
The text was updated successfully, but these errors were encountered: