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

Add ability to generate lean versions of chunks for SSR #8315

Closed
4 tasks done
the-illarionov opened this issue May 24, 2022 · 3 comments
Closed
4 tasks done

Add ability to generate lean versions of chunks for SSR #8315

the-illarionov opened this issue May 24, 2022 · 3 comments
Labels
wontfix This will not be worked on

Comments

@the-illarionov
Copy link

Clear and concise description of the problem

In VitePress, each chunk has it's lean version without any static VNodes. It would be great, if we could have out-of-the-box in Vite too. And also get rid of all TextNodes and all stuff, that already comes in SSR html, leaving only interactive blocks.

Suggested solution

It would be great if we could type:
vite build --lean

And it would result in:

- dist/
  - index.html
  - assets/
    - MyModule.hash.js
    - MyModule.hash.lean.js

Alternative

No response

Additional context

No response

Validations

@meteorlxy
Copy link
Contributor

A standalone vite plugin is possible, but it will still require adapting your client code to work with the lean build, just like how VitePress does. BTW, I think MPA is more suitable for lean build than SPA, and that's why VitePress dropped vue-router, and tried to support MPA mode.

Anyway, it's currently a vue-only feature, and I think it should not be included in the vite core.

@the-illarionov
Copy link
Author

the-illarionov commented May 27, 2022

@meteorlxy yeah, i've made another feature request #8314 which will make it super easy for client code. And it should not be a MPA, it's more "SSG-SPA", like Evan called it. It's when on your initial visit you get generated html and then continue spa-routing.
Actually, i've made it work right now without any plugins, but it required to make some dirty hacks with nginx routing (i pasted solution in that issue).

@sapphi-red
Copy link
Member

I don't think we could abstract this feature among users and also this could be achieved by a plugin.

@sapphi-red sapphi-red closed this as not planned Won't fix, can't repro, duplicate, stale Oct 29, 2022
@sapphi-red sapphi-red added wontfix This will not be worked on and removed enhancement: pending triage labels Oct 29, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Nov 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants