-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
feat(nuxt): client only page #25037
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
feat(nuxt): client only page #25037
Conversation
|
โ Live Preview ready!
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoa - thank you! โค๏ธ
I wonder if we can implement this at build-time to avoid even including these pages in the server bundle (at the moment, they will be).
So, when we scan pages here:
nuxt/packages/nuxt/src/pages/utils.ts
Line 340 in e084ee7
route.component = genDynamicImport(file, { interopDefault: true }) |
we could instead use a virtual file that is handled by a build plugin. That build plugin would generate code that wraps the pages with createClientOnly
.
I'm suggesting this because I think it will pair better with the implementation of server pages, which can be done in the same way (cc: @huang-julien)
Co-authored-by: Alexander Lichter <[email protected]>
Co-authored-by: Alexander Lichter <[email protected]>
This reverts commit 44e0750.
@danielroe Implemented something like what you said. But it has one issue, when wrapped in wdyt about build file that reexports |
I think that would probably be a good solution ๐ |
This reverts commit 16e2761.
it would not be possible without Julien Huang
๐ Linked issue
#24866
โ Type of change
๐ Description
resolves #24866
๐ Checklist